set the frame's `fullscreen-restore' parameter to `maximized', so
the frame will be maximized after disabling fullscreen state.
+If you wish to hide the title bar when the frame is maximized, you
+can add something like the following to your init file:
+
+ (add-hook \\='window-size-change-functions
+ #\\='frame-hide-title-bar-when-maximized)
+
Note that with some window managers you may have to set
`frame-resize-pixelwise' to non-nil in order to make a frame
appear truly maximized. In addition, you may have to set
bidi-display-reordering
bidi-inhibit-bpa))
+(defun frame-hide-title-bar-when-maximized (frame)
+ "Hide the title bar if FRAME is maximized.
+If FRAME isn't maximized, show the title bar."
+ (set-frame-parameter
+ frame 'undecorated
+ (eq (alist-get 'fullscreen (frame-parameters frame)) 'maximized)))
+
(provide 'frame)
;;; frame.el ends here
Functions specified by the default value are called for each frame if
at least one window on that frame has been added or changed its buffer
or its total or body size since the last redisplay. In this case the
-frame is passed as argument. */);
+frame is passed as argument.
+
+For instance, to hide the title bar when the frame is maximized, you
+can add `frame-hide-title-bar-when-maximized' to this variable. */);
Vwindow_size_change_functions = Qnil;
DEFVAR_LISP ("window-selection-change-functions", Vwindow_selection_change_functions,