Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame

From: martin rudalics <[email-masked]>
Date: Tue, 08 Sep 2015 21:22:07 +0200

> With this feature request (#21415), I was hoping to incorporate the
 > magic of `set-frame-size` with the pixelwise argument.  That function
 > is magical because it lets a user precisely control the outer
 > dimensions of a frame on OSX -- i.e., a user can make the outer
 > dimensions exactly one or more pixels larger or smaller.

There is no magic at all in ‘set-frame-size’.  Just that at the time you
call that function all those annoying calculations like how large is my
title bar or the external border have been already done by the window
manager.  And ‘set-frame-size’ doesn't have to care about idiosyncrasies
like adding fringe or scroll bar widths.

 > The patch, from what I understand, seeks to convert pixel
 > specifications into the standard character width and standard text
 > line height.

No.  These values are set eventually just like when you call
‘set-frame-size’.

 > I believe that method cannot be used to precisely
 > control the pixel outer dimensions of the frame.

It can.  But if and only if you know, for example, how large the title
bar and the external borders are.

 > The feature request (as I understand it) seeks to control the exact
 > pixel height/width of the outer frame -- irregardless of the character
 > width and text line height.

The character width and text line height are not consulted.  Provided
you have set ‘frame-resize-pixelwise’ to t.

 > For example, the laptop that I am using
 > today uses the following: `(set-frame-size FRAME 1260 774 t)` to
 > precisely fill the display. The corresponding frame parameters are
 > (width . 114) (height . 38); however, those are insufficient to fill
 > the screen precisely.

These frame parameters contain rounded values.  Just ignore them.

 > I can get close (but no cigar) with (width
 > . 114) (height . 38), and then I need to use `(set-frame-size FRAME
 > 1260 774 t)` to fix what `make-frame` cannot accomplish.

Have you tried to do the calculations I sent you in my previous mail?
Once you've done them, ‘make-frame’ should be able to do what you want.

martin