mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
Use active-minibuffer-window' rather than
minibuffer-window'
* exwm-layout.el (exwm-layout--on-minibuffer-setup) (exwm-layout--on-echo-area-change): Use `active-minibuffer-window`, instead of the minibuffer window of selected frame, as there's no guarantee that the selected frame is the frame containing the minibuffer. Also make sure the frame is an EXWM workspace.
This commit is contained in:
parent
1c706daeb0
commit
b62d5e79b0
1 changed files with 9 additions and 8 deletions
|
@ -403,21 +403,22 @@ selected by `other-buffer'."
|
||||||
(defun exwm-layout--on-minibuffer-setup ()
|
(defun exwm-layout--on-minibuffer-setup ()
|
||||||
"Refresh layout when minibuffer grows."
|
"Refresh layout when minibuffer grows."
|
||||||
(exwm--log)
|
(exwm--log)
|
||||||
;; Only when the minibuffer's frame is an EXWM frame.
|
;; Only when active minibuffer's frame is an EXWM frame.
|
||||||
;; FIXME: would it be enough checking for workspace frames?
|
(let* ((mini-window (active-minibuffer-window))
|
||||||
(when (exwm--terminal-p)
|
(frame (window-frame mini-window)))
|
||||||
|
(when (exwm-workspace--workspace-p frame)
|
||||||
(exwm--defer 0 (lambda ()
|
(exwm--defer 0 (lambda ()
|
||||||
(when (< 1 (window-height (minibuffer-window)))
|
(when (< 1 (window-height mini-window)))
|
||||||
(exwm-layout--refresh))))))
|
(exwm-layout--refresh frame))))))
|
||||||
|
|
||||||
(defun exwm-layout--on-echo-area-change (&optional dirty)
|
(defun exwm-layout--on-echo-area-change (&optional dirty)
|
||||||
"Run when message arrives or in `echo-area-clear-hook' to refresh layout."
|
"Run when message arrives or in `echo-area-clear-hook' to refresh layout."
|
||||||
(let ((frame (window-frame (minibuffer-window)))
|
(let ((frame (window-frame (active-minibuffer-window)))
|
||||||
(msg (current-message)))
|
(msg (current-message)))
|
||||||
;; Check whether the frame where current window's minibuffer resides (not
|
;; Check whether the frame where current window's minibuffer resides (not
|
||||||
;; current window's frame for floating windows!) must be adjusted.
|
;; current window's frame for floating windows!) must be adjusted.
|
||||||
(when (and msg
|
(when (and msg
|
||||||
(exwm--terminal-p frame)
|
(exwm-workspace--workspace-p frame)
|
||||||
(or (cl-position ?\n msg)
|
(or (cl-position ?\n msg)
|
||||||
(> (length msg) (frame-width frame))))
|
(> (length msg) (frame-width frame))))
|
||||||
(exwm--log)
|
(exwm--log)
|
||||||
|
|
Loading…
Reference in a new issue