unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35059: window-setup-hook not working with the new frame parameters
@ 2019-03-31  5:57 Michael Wu
  2019-03-31  8:20 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Wu @ 2019-03-31  5:57 UTC (permalink / raw)
  To: 35059

[-- Attachment #1: Type: text/plain, Size: 6473 bytes --]

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



In GNU Emacs 26.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.23.2)
 of 2018-08-13 built on buildvm-13.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.12003000
System Description: Fedora release 29 (Twenty Nine)

Recent messages:
Wrote /home/OP/core/mind/sys/proc/as.md
Saving file /home/OP/core/mind/sys/proc/as.md...
Wrote /home/OP/core/mind/sys/proc/as.md
Saving file /home/OP/core/mind/sys/proc/main.org...
Wrote /home/OP/core/mind/sys/proc/main.org
command-execute: Command attempted to use minibuffer while in minibuffer
Quit [2 times]
C-x C-g is undefined
Mark set
Making completion list...

Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets --with-modules
 build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security
 -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
 -fstack-protector-strong -grecord-gcc-switches
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS XWIDGETS LCMS2

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
/usr/share/asymptote/asy-keywords hides
/usr/share/emacs/site-lisp/asymptote/asy-keywords
/usr/share/asymptote/asy-mode hides
/usr/share/emacs/site-lisp/asymptote/asy-mode
/usr/share/asymptote/asy-init hides
/usr/share/emacs/site-lisp/site-start.d/asy-init
/usr/share/emacs/site-lisp/site-start.d/maxima-modes hides
/usr/share/emacs/site-lisp/maxima/site_start.d/maxima-modes

Features:
(shadow sort emacsbug sendmail dired-aux mail-extr utop utop-minor-mode
pcase vc-git diff-mode apropos misearch multi-isearch pulse xref project
ruler-mode hl-line hexl pcmpl-unix pp cus-edit cus-start cus-load
cl-print eieio-opt speedbar sb-image ezimage dframe completion help-fns
radix-tree cl-extra help-mode markdown-mode color thingatpt shell
org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group
gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls
utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc
puny rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mail-utils mm-util mail-prsvr wid-edit org-docview doc-view jka-compr
image-mode dired dired-loaddefs org-bibtex bibtex org-bbdb org-w3m
org-element avl-tree generator org advice org-macro org-footnote
org-pcomplete pcomplete org-list org-faces org-entities noutline outline
easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob
ob-table ob-keys ob-exp ob-comint comint ansi-color ring ob-core ob-eval
org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar
cal-loaddefs elec-pair edmacro kmacro server finder-inf tex-site
proof-site proof-autoloads pg-vars rx info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib emacs-goodies-loaddefs time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting xwidget-internal
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 436153 75706)
 (symbols 48 41249 2)
 (miscs 40 840 1305)
 (strings 32 141082 5579)
 (string-bytes 1 3831899)
 (vectors 16 49868)
 (vector-slots 8 1694714 196144)
 (floats 8 392 1080)
 (intervals 56 2214 433)
 (buffers 992 30))

[-- Attachment #2: Type: text/html, Size: 8499 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#35059: window-setup-hook not working with the new frame parameters
  2019-03-31  5:57 bug#35059: window-setup-hook not working with the new frame parameters Michael Wu
@ 2019-03-31  8:20 ` Eli Zaretskii
  2020-08-18 16:50   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2019-03-31  8:20 UTC (permalink / raw)
  To: JohnMichaelWu, Michael Wu, 35059

On March 31, 2019 8:57:18 AM GMT+03:00, Michael Wu <john.michael.wu@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#35059: window-setup-hook not working with the new frame parameters
  2019-03-31  8:20 ` Eli Zaretskii
@ 2020-08-18 16:50   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2020-08-18 16:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: JohnMichaelWu, Michael Wu, 35059

tags 35059 + notabug
close 35059
thanks

Eli Zaretskii <eliz@gnu.org> writes:

> On March 31, 2019 8:57:18 AM GMT+03:00, Michael Wu <john.michael.wu@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.

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-18 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31  5:57 bug#35059: window-setup-hook not working with the new frame parameters Michael Wu
2019-03-31  8:20 ` Eli Zaretskii
2020-08-18 16:50   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).