mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-27 13:07:59 +01:00
Use pre-redisplay-function
to detect mini-window resizes.
Fixes https://github.com/ch11ng/exwm/issues/40 See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21333
This commit is contained in:
parent
b50a6e6dd9
commit
d7a86d2549
1 changed files with 5 additions and 13 deletions
|
@ -189,8 +189,8 @@
|
|||
:height height))
|
||||
(xcb:flush exwm--connection))))
|
||||
|
||||
(defun exwm-layout--refresh ()
|
||||
"Refresh layout."
|
||||
(defun exwm-layout--refresh (&rest args)
|
||||
"Refresh layout. ARGS are ignored to run in abnormal hooks."
|
||||
(let ((frame (selected-frame))
|
||||
(placeholder (get-buffer "*scratch*"))
|
||||
windows)
|
||||
|
@ -236,21 +236,13 @@
|
|||
(or exwm--floating-frame (not (eq frame exwm--frame))))
|
||||
(set-window-buffer window placeholder)))))))
|
||||
|
||||
(defun exwm-layout--on-minibuffer-setup ()
|
||||
"Refresh layout when minibuffer grows."
|
||||
(run-with-idle-timer 0.01 nil ;FIXME
|
||||
(lambda ()
|
||||
(when (and (< 1 (window-height (minibuffer-window)))
|
||||
(not (and (eq major-mode 'exwm-mode)
|
||||
exwm--floating-frame)))
|
||||
(exwm-layout--refresh)))))
|
||||
|
||||
(defun exwm-layout--init ()
|
||||
"Initialize layout module."
|
||||
;; Auto refresh layout
|
||||
(add-hook 'window-configuration-change-hook 'exwm-layout--refresh)
|
||||
;; Refresh when minibuffer grows
|
||||
(add-hook 'minibuffer-setup-hook 'exwm-layout--on-minibuffer-setup t))
|
||||
;; Refresh when minibuffer grows, if Emacs is new enough to detect it
|
||||
(when (boundp 'pre-redisplay-function)
|
||||
(add-function :before pre-redisplay-function 'exwm-layout--refresh)))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue