[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window change functions

From: Stefan Monnier
Subject: Re: Window change functions
Date: Sun, 06 Jan 2019 12:22:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> For example, I have a window-size-change-functions which I use to
>> re-balance windows (using balance-window-area) after a frame resize.
> Have you ever tried without that?

Yes, of course.

> Resizing a frame should resize windows proportionally which, if
> windows were balanced before the resizing, should leave them
> balanced afterwards.

Yes, it works OK most of the time, but repeated resizing seems to
accumulate errors (it's better now with pixelwise window sizing, tho),
and it doesn't correctly handle more complex setups where some windows
have a fixed size and where I want relative area to be preserved for
windows of different aspect ratios (where horizontal resizing of the
frame may require vertical resizing of some windows, for example).

>> It doesn't care about the exact window sizes when it's called, so having
>> correct window sizes when it's called is not necessary.  OTOH redisplay
>> will need to happen right after it was run, because it changes
>> window sizes.  So the best time to run it is right before redisplay.
> Not really.  The run_window_change_functions calls in redisplay come
> right after do_pending_window_change calls.  So the former should in
> the fastest possible way pick up any changes caused by the latter.

Hmm... so frame resizing only triggers late... that's a good point.

So I guess the remaining cases are hypothetical ones (e.g. if you
want to put the window dimension in the mode-line).  I haven't tried
those to see if they'd be handled correctly.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]