help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Frame resize hook?


From: Juan Pedro Bolivar Puente
Subject: Re: Frame resize hook?
Date: Wed, 22 Apr 2009 19:04:00 +0200
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

> 
> Perhaps with an advice, but ISTR that advices are not called when the
> function is called from within the C layer of emacs (the calls are
> "open coded" there).  So it would work only if the frame resizing is
> done from lisp code.
> 
> The functions to advice would be set-frame-size, set-frame-width and 
> set-frame-height.
> (perhaps also set-frame-position).
> 
> Cf. defadvice
> 
> Otherwise, you would have to patch the C code of these primitive functions.
> 

I tried adding:

(defadvice set-frame-size (after jpb-advice-resize-1)
  (ecb-redraw-layout))
(defadvice set-frame-width (after jpb-advice-resize-2)
  (ecb-redraw-layout))
(defadvice set-frame-height (after jpb-advice-resize-2)
  (ecb-redraw-layout))
(ad-activate 'set-frame-size)
(ad-activate 'set-frame-width)
(ad-activate 'set-frame-height)

But, as you said, it only works when calling set-frame-xxx from Elisp
code, not on window manager events.

Thanks for the tip anyways, I didn't know about "advices".

JP





reply via email to

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