From: martin rudalics <rudalics@gmx.at>
To: Pip Cet <pipcet@gmail.com>
Cc: 21333@debbugs.gnu.org
Subject: bug#21333: 25.0.50; window-size-change-functions not called after mini-window resize
Date: Thu, 27 Aug 2015 09:59:04 +0200 [thread overview]
Message-ID: <55DEC348.8080306@gmx.at> (raw)
In-Reply-To: <CAOqdjBcvPafxyU0R6kkmnVA4kEyGrBxvvoe6=S5M9Ra8oUvFyw@mail.gmail.com>
> I understood Eli differently. If I'm not misquoting him, his suggestion was
> to "simply recompute the coordinates every time they are needed". My
> objection to that is that in many applications, you don't know when the
> coordinates will be needed without changing other programs.
There's no need to ever recompute coordinates. They are here all the
time. What's needed is to record previous coordinates and to compare
them with the actual ones.
>> Even simpler: We could store the sizes in the window structure. This
>> way prepare_menu_bars would simply walk the window tree of each frame to
>> detect whether the size of any window has changed, call the functions on
>> ‘window-size-change-functions’ and afterwards (better when redisplay
>> completed) store the current size values into the old ones.
>
> Would (window-size) return the old or the new size values?
All existing functions (like ‘window-size’) would obviously remain
unchanged. We would provide a new function, say ‘window-old-size’, to
return the width or height of a window at the time the last redisplay
finished.
> Is there consensus for keeping pre-redisplay-function?
Sure. It's been only added in 2013.
> windows.texi:
> @defvar window-configuration-change-hook
> A normal hook that is run every time you change the window configuration
> of an existing frame. This includes splitting or deleting windows,
> *changing the sizes of windows*, or displaying a different buffer in a
> window.
Damn.
> I think it's at least possible to read that as applying to window resize
> operations.
At least.
>>> - document set-window-configuration doesn't call
>>> window-size-change-functions if nothing changed
>>
>> No (because IIRC we never document fixed bugs).
>
> Are you sure? It occurs to me I should have said "remove the bit in the
> documentation that says window-size-change-functions is always called by
> set-window-configuration". It's not about documenting the bugfix, but
> undocumenting the old bug.
You're right again. I suppose that what we wanted to say there is that
we always call ‘window-configuration-change-hook’.
>>> - wishlist item: call pre-redisplay-function between
>>> grow/shrink_mini_window and the actual X repaint, rather than before.
>>
>> Are you sure? If prepare_menu_bars is called before auto-resizing the
>> minibuffer window, then ‘window-size-change-functions’ wouldn't catch
>> those auto-resizes either.
>
> That's why I consider it "wishlist". My Christmas wish is to be told
> whenever the X rectangle corresponding to my Emacs window has changed, just
> before the X server is told about the change.
I still don't understand: Do you mean that ‘pre-redisplay-function’ is
called in the wrong place? Where else would you call it?
> Should that be impossible? As far as I can tell, the documentation reads
> like it should be possible. At least some people make use of it, if in ways
> you probably think useless.
>
> I consider the documentation to be more authoritative than current
> behavior: if a feature should work according to the documentation, but
> doesn't, I think the right thing to do is almost always to fix the feature
> and then, afterwards, discuss whether it should be removed.
If we can fix the feature, yes.
>>> - mark window-size-change-functions as obsolete and see whether
>>> anyone complains?
>>
>> This will happen if we don't provide a good subsitute.
>
> Wait, don't you mean that will happen if we do provide a good substitute?
If ‘pre-redisplay-function’ can do the job it's a good substitute.
>>> + if (w->pixel_left != XFASTINT (p->pixel_left) ||
>>> + w->pixel_top != XFASTINT (p->pixel_top) ||
>>> + w->pixel_width != XFASTINT (p->pixel_width) ||
>>> + w->pixel_height != XFASTINT (p->pixel_height))
>>
>> You still didn't explain why you find it necessary to compare the
>> pixel_left and pixel_top values.
...
> Reasons for calling pre-redisplay-function in these cases: Mouseover, if
> you need more than text properties give you. Cursor warping. X hacks. It's
> what the previous code did, so I didn't dare change it.
But this would imply that we also had to care about the case where a
window's body width or height changes. Discriminating that is pretty
difficult since we don't store that in a window configuration. And even
the body width remains unchanged when I move a window's scroll bar from
the left to the right.
martin
next prev parent reply other threads:[~2015-08-27 7:59 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
2016-02-22 12:59 ` Fix `window-configuration-change-hook' and `window-size-change-functions' martin rudalics
2016-02-23 11:31 ` martin rudalics
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55DEC348.8080306@gmx.at \
--to=rudalics@gmx.at \
--cc=21333@debbugs.gnu.org \
--cc=pipcet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.