window-pixel-width-before-size-change is available since Emacs 26

* exwm-layout.el (exwm-layout--init, exwm-layout--exit): Remove fboundp check.
This commit is contained in:
Daniel Mendler 2024-03-15 19:05:13 +01:00
parent 1ebd135f45
commit 99442909be
No known key found for this signature in database
GPG key ID: D88ADB2A2693CA43

View file

@ -602,9 +602,7 @@ See also `exwm-layout-enlarge-window'."
;; Auto refresh layout
(exwm--log)
(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))
(add-hook 'window-size-change-functions #'exwm-layout--refresh)
(unless (exwm-workspace--minibuffer-own-frame-p)
;; Refresh when minibuffer grows
(add-hook 'minibuffer-setup-hook #'exwm-layout--on-minibuffer-setup t)
@ -616,8 +614,7 @@ See also `exwm-layout-enlarge-window'."
"Exit the layout module."
(exwm--log)
(remove-hook 'window-configuration-change-hook #'exwm-layout--refresh)
(when (fboundp 'window-pixel-width-before-size-change)
(remove-hook 'window-size-change-functions #'exwm-layout--refresh))
(remove-hook 'window-size-change-functions #'exwm-layout--refresh)
(remove-hook 'minibuffer-setup-hook #'exwm-layout--on-minibuffer-setup)
(when exwm-layout--timer
(cancel-timer exwm-layout--timer)