unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21333: 25.0.50; window-size-change-functions not called after mini-window resize
@ 2015-08-23 22:06 Pip Cet
  2015-08-24  8:18 ` martin rudalics
  2015-08-24 14:35 ` Eli Zaretskii
  0 siblings, 2 replies; 55+ messages in thread
From: Pip Cet @ 2015-08-23 22:06 UTC (permalink / raw)
  To: 21333

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

This is possibly only a documentation issue.

Recipe: eval
(progn (push (lambda (&rest args) (message "window size changed"))
window-size-change-functions)
    (message (make-string 3000 ?*)))

Expected result: a "window size changed" message.

Actual result: no such message.


The symptom is that the window size change function is not run after a
mini-window size change.

So far, I can produce this behavior only when the minibuffer or echo
area grows to several lines; when it shrinks afterwards, my window size
change function is called. I cannot reproduce the behavior with other
windows.

Is this a bug? The documentation says:

    [...] to be called if the size of any window changes for any reason.

Please correct me if I'm wrong, but when the minibuffer/echo area gets
resized (and the windows on top of it, too), that counts as a change of
size, I would say.

If this is merely a documentation issue, the exception should be noted
in the manual.


Analysis:
First, some warnings:
 - `window_resize_apply' and `Fwindow_resize_apply' (aka
   `window-resize-apply') are two different functions
 - `resize-mini-window' and `resize-mini-window-internal' are called
   only when the mini-window is explicitly resized by a Lisp call of
   `resize-mini-window'. Implicit resizes as a consequence of having
   too much text in the echo area do not appear to call it.

The problem is that FRAME_WINDOW_SIZES_CHANGED (f) is not set to true
after a mini-window resize. Fwindow_resize_apply would set this flag,
but window_resize_apply does not.

If this behavior is deliberate, I believe it is inconsistent to set
FRAME_WINDOW_SIZES_CHANGED (f) in `resize-mini-window-internal'.


Suggested solution:

Trivial. Add FRAME_WINDOW_SIZES_CHANGED (f) = true to all callers of
window_resize_apply.


In GNU Emacs 25.0.50.51 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-08-23 on ...
Repository revision: bfb06826feac9151877069590d5dc91b60337b6b
Windowing system distributor `The X.Org Foundation', version 11.0.11702000
System Description:    Debian GNU/Linux unstable (sid)

Configured using:
 `configure 'CFLAGS=-O0 -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GCONF GSETTINGS NOTIFY LIBSELINUX
GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-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
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr
mail-utils misearch multi-isearch time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev 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 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 81668 9633)
 (symbols 48 19040 0)
 (miscs 40 42 136)
 (strings 32 13288 4444)
 (string-bytes 1 380166)
 (vectors 16 11279)
 (vector-slots 8 414205 3702)
 (floats 8 131 186)
 (intervals 56 190 0)
 (buffers 976 11)
 (heap 1024 18666 1015))

[-- Attachment #2: 0001-Call-window-size-change-functions-after-mini-window-.patch --]
[-- Type: text/x-patch, Size: 1376 bytes --]

From 243be700591979554e61bbdff0f00f30cc386f7b Mon Sep 17 00:00:00 2001
From: Philip <pipcet@gmail.com>
Date: Sun, 23 Aug 2015 21:46:42 +0000
Subject: [PATCH] Call `window-size-change-functions' after mini-window size
 changes.

	* window.c (resize_frame_windows): Set
	FRAME_WINDOW_SIZES_CHANGED flag.  (grow_mini_window):
	Likewise.  (shrink_mini_window): Likewise.
---
 src/window.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/window.c b/src/window.c
index 863a792..68bc9e5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4094,6 +4094,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
     }
 
   fset_redisplay (f);
+  FRAME_WINDOW_SIZES_CHANGED (f) = true;
 }
 
 
@@ -4531,6 +4532,7 @@ grow_mini_window (struct window *w, int delta, bool pixelwise)
 	  /* Enforce full redisplay of the frame.  */
 	  /* FIXME: Shouldn't window--resize-root-window-vertically do it?  */
 	  fset_redisplay (f);
+	  FRAME_WINDOW_SIZES_CHANGED (f) = true;
 	  adjust_frame_glyphs (f);
 	  unblock_input ();
 	}
@@ -4570,6 +4572,7 @@ shrink_mini_window (struct window *w, bool pixelwise)
 	  /* Enforce full redisplay of the frame.  */
 	  /* FIXME: Shouldn't window--resize-root-window-vertically do it?  */
 	  fset_redisplay (f);
+	  FRAME_WINDOW_SIZES_CHANGED (f) = true;
 	  adjust_frame_glyphs (f);
 	  unblock_input ();
 	}
-- 
2.5.0


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

end of thread, other threads:[~2015-08-28 13:26 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 22:06 bug#21333: 25.0.50; window-size-change-functions not called after mini-window resize Pip Cet
2015-08-24  8:18 ` martin rudalics
2015-08-24 11:08   ` Pip Cet
2015-08-24 12:41     ` martin rudalics
2015-08-24 14:35 ` Eli Zaretskii
2015-08-24 18:06   ` martin rudalics
2015-08-24 18:30     ` Eli Zaretskii
2015-08-25  7:25       ` martin rudalics
2015-08-25 10:34         ` Pip Cet
2015-08-25 15:19           ` Eli Zaretskii
2015-08-26  7:08           ` martin rudalics
2015-08-25 15:11         ` Eli Zaretskii
2015-08-26  7:09           ` martin rudalics
2015-08-26 15:29             ` Eli Zaretskii
2015-08-27  7:57               ` martin rudalics
2015-08-27 15:29                 ` Eli Zaretskii
2015-08-27 17:05                   ` Pip Cet
2015-08-27 17:59                     ` martin rudalics
2015-08-27 18:04                       ` Pip Cet
2015-08-28  8:03                         ` martin rudalics
2015-08-28  8:19                           ` Pip Cet
2015-08-28  8:45                             ` Pip Cet
2015-08-27 18:35                     ` Eli Zaretskii
2015-08-27 17:58                   ` martin rudalics
2015-08-24 18:13   ` Pip Cet
2015-08-24 19:03     ` Eli Zaretskii
2015-08-25  7:25       ` martin rudalics
2015-08-25 15:12         ` Eli Zaretskii
2015-08-26  7:09           ` martin rudalics
2015-08-26 10:07             ` Pip Cet
2015-08-26 13:01               ` martin rudalics
2015-08-26 16:00                 ` Pip Cet
2015-08-27  7:59                   ` martin rudalics
2015-08-27 15:25                     ` Eli Zaretskii
2015-08-27 16:35                       ` Pip Cet
2015-08-27 17:59                         ` martin rudalics
2015-08-27 18:57                         ` Eli Zaretskii
2015-08-27 20:49                           ` Pip Cet
2015-08-28 10:02                             ` Eli Zaretskii
2015-08-28 12:34                               ` Pip Cet
2015-08-28 13:13                                 ` Eli Zaretskii
2015-08-28 13:26                                   ` Pip Cet
2015-08-26 15:36               ` Eli Zaretskii
2015-08-27  7:58                 ` martin rudalics
2015-08-27 15:24                   ` Eli Zaretskii
2015-08-27 17:58                     ` martin rudalics
2015-08-27 18:39                       ` Eli Zaretskii
2015-08-27 19:00                         ` Eli Zaretskii
2015-08-28  8:04                           ` martin rudalics
2015-08-28  8:47                             ` Eli Zaretskii
2015-08-28 10:51                               ` martin rudalics
2015-08-28 12:46                                 ` Eli Zaretskii
2015-08-28 13:05                                   ` martin rudalics
2015-08-26 15:32             ` Eli Zaretskii
2015-08-27  7:57               ` martin rudalics

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).