[Top][All Lists]

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

Re: HowTo: Detect when a frame's size changes

From: martin rudalics
Subject: Re: HowTo: Detect when a frame's size changes
Date: Wed, 05 Apr 2017 08:58:30 +0200

> Is there a way to tell from elisp if the size of a frame changes? I went
> looking for some type of frame-resize-hook but didn't find any ---

If and when the change of the frame size is propagated to the frame's
windows, then with Emacs 26 `window-size-change-functions' should catch
them all.  With earlier Emacsen you might have to consult
`window-configuration-change-hook' as well.  And maybe some size changes
will not even be noticed.

Note that `window-size-change-functions' is also called when the
relative sizes of windows change.  So you have to store the previous
frame size and compare it with the current one to find out whether the
frame really changed size or only some of its windows.

Also note that size changes that do not affect the inner frame (like
adding or removing the menu or tool bar or a border) might not be
tracked at all.

In any case I'll have to add an appropriate link to the Elisp manual.


reply via email to

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