On 2023-09-28 22:05, chad wrote:
Apologies for joining late, and perhaps you have already tried and discounted this approach, but: Have you tried adding:

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

or perhaps

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

to early-init? I put the first above line in ~/.emacs.d/early-init.el, and got an initially maximized window under an odd Wayland+XWayland system as well as Win 11. I don't have reasonable access to either a more typical X11, Wayland, or macOS system right now.

The key is to put it in early-init.el, which is consulted before emacs makes any windows in any window system. Also worth noting: if you end up with conflicting elisp settings and X resources, there are a variety of ways for the latter to silently override the former. You can check this with "xrdb -query" (you might want to run this in a shell buffer or pipe it to a pager).

Hope this helps,
~Chad

Wouldn't it be useful to write some lisp that could automatically generate ~/.emacs.d/early-init.el from .emacs?:

* Check if ~/.emacs.d/early-init.el contains:

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

* If ~/.emacs.d/early-init.el does

  * not exist

  * exist but does not contain the above code

  then:

    * add the above code to ~/.emacs.d/early-init.el

    * restart emacs or send a message to the minibuffer that it must be restarted in order for the setting to take effect.