elisp: Implied Frame Resizing
28.3.4 Implied Frame Resizing
-----------------------------
By default, Emacs tries to keep the number of lines and columns of a
frame’s text area unaltered when, for example, adding or removing the
menu bar, changing the default font or setting the width of the frame’s
scroll bars. This means, however, that in such case Emacs must ask the
window manager to resize the outer frame in order to accommodate the
size change. Note that wrapping a menu or tool bar usually does not
resize the frame’s outer size, hence this will alter the number of
displayed lines.
Occasionally, such “implied frame resizing” may be unwanted, for
example, when the frame is maximized or made full-screen (where it’s
turned off by default). In other cases you can disable implied resizing
with the following option:
-- User Option: frame-inhibit-implied-resize
If this option is ‘nil’, changing font, menu bar, tool bar,
internal borders, fringes or scroll bars of a specific frame may
implicitly resize the frame’s display area in order to preserve the
number of columns or lines the frame displays. If this option is
non-‘nil’, no implied resizing is done.
The value of this option can be also be a list of frame parameters.
In that case, implied resizing is inhibited when changing a
parameter that appears in this list. The frame parameters
currently handled by this option are: ‘font’, ‘font-backend’,
‘internal-border-width’, ‘menu-bar-lines’ and ‘tool-bar-lines’.
Changing any of the ‘scroll-bar-width’, ‘scroll-bar-height’,
‘vertical-scroll-bars’, ‘horizontal-scroll-bars’, ‘left-fringe’ and
‘right-fringe’ frame parameters is handled as if the frame
contained just one live window. This means, for example, that
removing vertical scroll bars on a frame containing several side by
side windows will shrink the outer frame width by the width of one
scroll bar provided this option is ‘nil’ and keep it unchanged if
this option is either ‘t’ or a list containing
‘vertical-scroll-bars’.
The default value is ‘'(tool-bar-lines)’ for Lucid, Motif and
Windows (which means that adding/removing a tool bar there does not
change the outer frame height), ‘nil’ on all other window systems
including GTK+ (which means that changing any of the parameters
listed above may change the size of the outer frame), and ‘t’
otherwise (which means the outer frame size never changes
implicitly when there’s no window system support).
Note that when a frame is not large enough to accommodate a change
of any of the parameters listed above, Emacs may try to enlarge the
frame even if this option is non-‘nil’.