On 2023-10-23 17:33, Stefan Kangas wrote:
Eli Zaretskii <eliz@gnu.org> writes:

Right, but taking a step back here: should we consider that as a bug?

IOW, instead of documenting workarounds, why isn't --maximized fixed to
not have the "slightly distracting visual effect"?  Is that impractical
for some reason?
Is this really about --maximized?  I thought this was about
customizations in the init file that cause frames to be maximized.
The --maximized switch creates the frame maximized from the get-go
here.
You are correct, sorry for the confusion.  It's good to learn that
--maximized works without issue.

So I guess this discussion is about:

    (add-hook 'emacs-startup-hook 'toggle-frame-maximized)

Then I guess I have the same question, but for that customization.  Why
do we suggest a customization which has a "slighty distracting visual
effect"?

That is why I wrote this section in https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html

-----------------------------------8<----------------------------------------------

Alternatively, you can avoid the visual effect of Emacs changing its frame size entirely in your init file (i.e., without using the Registry), like this:

(setq frame-resize-pixelwise t)
(set-frame-position nil 0 0)
(set-frame-size nil (display-pixel-width) (display-pixel-height) t)

---------------------------------->8------------------------------------------------

However, it doesn't work in GNU/Linux.


  Can we come up with a way to provide a one-line customization
that does not have this issue?

As mentioned in the thread with Subject: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux - Improved solution by Chad: ~/.emacs.d/early-init.el (https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00070.html) a one-line customization that works is to add this to .emacs.d/early-init.el:

    (push '(fullscreen . maximized) default-frame-alist)

* It works even if it takes time to load a typical .emacs configuration

* I've successfully tested it in GNU/Linux (both X11, and Wayland), and Windows.


PS.  On a side note, --maximized doesn't seem to work on this macOS
     machine.  I'll open a separate bug report for that.

Thank you very much!