GNU bug report logs - #35059
window-setup-hook not working with the new frame parameters

Previous Next

Package: emacs;

Reported by: JohnMichaelWu <at> gmail.com

Date: Sun, 31 Mar 2019 07:18:02 UTC

Severity: normal

Tags: notabug

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: JohnMichaelWu <at> gmail.com, Michael Wu <john.michael.wu <at> gmail.com>, 35059 <at> debbugs.gnu.org
Subject: bug#35059: window-setup-hook not working with the new frame parameters
Date: Sun, 31 Mar 2019 11:20:35 +0300
On March 31, 2019 8:57:18 AM GMT+03:00, Michael Wu <john.michael.wu <at> gmail.com> 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.




This bug report was last modified 4 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.