Parameters describing the X- and Y-offsets of a frame are always measured in pixels. For a normal, non-child frame they specify the frame's outer position (see Frame Geometry) relative to its display's origin. For a child frame (see Child Frames) they specify the frame's outer position relative to the native position of the frame's parent frame. (Note that none of these parameters is meaningful on TTY frames.)
Emacs will try to keep the position ratios of a child frame unaltered if
that frame has a non-
(see Frame Interaction Parameters) and its parent frame is resized.
Since the outer size of a frame (see Frame Geometry) is usually unavailable before a frame has been made visible, it is generally not advisable to use floating-point values when creating decorated frames. Floating-point values are more suited for ensuring that an (undecorated) child frame is positioned nicely within the area of its parent frame.
Some window managers ignore program-specified positions. If you want to
be sure the position you specify is not ignored, specify a
nil value for the
user-position parameter as in the
(modify-frame-parameters nil '((user-position . t) (left . (+ -4))))
In general, it is not a good idea to position a frame relative to the right or bottom edge of its display. Positioning the initial or a new frame is either not accurate (because the size of the outer frame is not yet fully known before the frame has been made visible) or will cause additional flicker (if the frame has to be repositioned after becoming visible).
Note also, that positions specified relative to the right/bottom edge
of a display, workarea or parent frame as well as floating-point offsets
are stored internally as integer offsets relative to the left/top edge
of the display, workarea or parent frame edge. They are also returned
as such by functions like
frame-parameters and restored as such
by the desktop saving routines.
left, except vertically instead of horizontally.
icon-topand vice versa.
topparameters, use this parameter to say whether the specified position was user-specified (explicitly requested in some way by a human user) or merely program-specified (chosen by a program). A non-
nilvalue says the position was user-specified.
Window managers generally heed user-specified positions, and some heed
program-specified positions too. But many ignore program-specified
positions, placing the window in a default fashion or letting the user
place it with the mouse. Some window managers, including
let the user specify whether to obey program-specified positions or
When you call
make-frame, you should specify a non-
value for this parameter if the values of the
parameters represent the user's stated preference; otherwise, use
If this is
above, the frame's window-system window is displayed
above all other window-system windows that do not have the
property set. If this is
nil, the frame's window is displayed below all
windows that have the
above property set and above all windows
that have the
below property set. If this is
frame's window is displayed below all windows that do not have the
below property set.
To position the frame above or below a specific other frame use the
frame-restack (see Raising and Lowering).