mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
Adapt for the changes in `window-configuration-change-hook'
* exwm-layout.el (exwm-layout--refresh): Accept frame as an optional argument. (exwm-layout--init): Add `exwm-layout--refresh' to `window-size-change-functions' when appropriate.
This commit is contained in:
parent
810b4716a1
commit
8e3fc3602f
1 changed files with 10 additions and 4 deletions
|
@ -314,10 +314,13 @@ selected by `other-buffer'."
|
||||||
:data (vconcat (append clients-other clients-iconic
|
:data (vconcat (append clients-other clients-iconic
|
||||||
clients clients-floating))))))
|
clients clients-floating))))))
|
||||||
|
|
||||||
(defun exwm-layout--refresh ()
|
(defun exwm-layout--refresh (&optional frame)
|
||||||
"Refresh layout."
|
"Refresh layout."
|
||||||
(let ((frame (selected-frame))
|
;; `window-size-change-functions' sets this argument while
|
||||||
covered-buffers ;EXWM-buffers covered by a new X window.
|
;; `window-configuration-change-hook' makes the frame selected.
|
||||||
|
(unless frame
|
||||||
|
(setq frame (selected-frame)))
|
||||||
|
(let (covered-buffers ;EXWM-buffers covered by a new X window.
|
||||||
vacated-windows ;Windows previously displaying EXWM-buffers.
|
vacated-windows ;Windows previously displaying EXWM-buffers.
|
||||||
windows)
|
windows)
|
||||||
(if (not (exwm-workspace--workspace-p frame))
|
(if (not (exwm-workspace--workspace-p frame))
|
||||||
|
@ -566,6 +569,9 @@ See also `exwm-layout-enlarge-window'."
|
||||||
"Initialize layout module."
|
"Initialize layout module."
|
||||||
;; Auto refresh layout
|
;; Auto refresh layout
|
||||||
(add-hook 'window-configuration-change-hook #'exwm-layout--refresh)
|
(add-hook 'window-configuration-change-hook #'exwm-layout--refresh)
|
||||||
|
;; The behavior of `window-configuration-change-hook' will be changed.
|
||||||
|
(when (fboundp 'window-pixel-width-before-size-change)
|
||||||
|
(add-hook 'window-size-change-functions #'exwm-layout--refresh))
|
||||||
(unless (exwm-workspace--minibuffer-own-frame-p)
|
(unless (exwm-workspace--minibuffer-own-frame-p)
|
||||||
;; Refresh when minibuffer grows
|
;; Refresh when minibuffer grows
|
||||||
(add-hook 'minibuffer-setup-hook #'exwm-layout--on-minibuffer-setup t)
|
(add-hook 'minibuffer-setup-hook #'exwm-layout--on-minibuffer-setup t)
|
||||||
|
|
Loading…
Reference in a new issue