Subject: bug#35059: window-setup-hook not working with the new frame parameters

From: Stefan Kangas <[email-masked]>
Date: Tue, 18 Aug 2020 16:50:19 +0000

tags 35059 + notabug
close 35059
thanks

Eli Zaretskii <[email-masked]> writes:

> On March 31, 2019 8:57:18 AM GMT+03:00, Michael Wu <[email-masked]> wrote:
>> See this StackOverflow thread:
>> https://emacs.stackexchange.com/questions/48645/if-start-with-maximized-frame-why-do-windows-open-top-bottom-not-side-by-side
>>
>> as well as Stefan's answer, and comments on that answer. Essentially,
>> I
>> do not believe window-setup-hook is properly running after all frame
>> parameters have been set, as is suggested in the documentation here:
>>
>> https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html
>
>
> There's nothing wrong with window-setup-hook, AFAICT, it indeed runs after all the parameters of the frame have been set according to your customizations.
>
> The problem is in your apparent assumption that frame maximization happens
> immediately after you put the fullscreen parameter into frame-parametets.  But
> actually, frame maximization is performed through interaction with the
> window-manager, which generally happens asynchronously and takes some short, but
> non-zero time.
>
> Add to your hook  a call to 'message' that displays the width and height of the selected window, and you will see why you get windows split vertically.
>
> The conclusion is that if you want to see windows split like you expected, you need to insert a wait into your  emacs.  Or just split horizontally by an explicit command.

No further updates within more than a year, so I'm closing this bug
report with the above explanation.

If this conclusion is incorrect, please reply to this email (use "Reply
to all" in your email client) and we can reopen the bug report.

Best regards,
Stefan Kangas