mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
Exit the active minibuffer on unmanaging X windows
* exwm-manage.el (exwm-manage--unmanage-window): Exit the minibuffer as a precaution to prevent the "selecting deleted buffer" error.
This commit is contained in:
parent
ba0f41db1b
commit
aa7de9dc6f
1 changed files with 20 additions and 8 deletions
|
@ -352,14 +352,26 @@ manager is shutting down."
|
||||||
;; Destroy the X window container (and the frame container if any).
|
;; Destroy the X window container (and the frame container if any).
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:DestroyWindow :window exwm--container))
|
(make-instance 'xcb:DestroyWindow :window exwm--container))
|
||||||
|
(exwm-manage--set-client-list)
|
||||||
|
(xcb:flush exwm--connection))
|
||||||
|
(let ((kill-buffer-func
|
||||||
|
(lambda (buffer)
|
||||||
|
(with-current-buffer buffer
|
||||||
(let ((kill-buffer-query-functions nil)
|
(let ((kill-buffer-query-functions nil)
|
||||||
(floating exwm--floating-frame))
|
(floating exwm--floating-frame))
|
||||||
(kill-buffer)
|
(kill-buffer)
|
||||||
(when floating
|
(when floating
|
||||||
(select-window
|
(select-window
|
||||||
(frame-selected-window exwm-workspace--current)))))
|
(frame-selected-window exwm-workspace--current))))))))
|
||||||
(exwm-manage--set-client-list)
|
(if (not (active-minibuffer-window))
|
||||||
(xcb:flush exwm--connection))))
|
;; Kill the buffer as usual.
|
||||||
|
(funcall kill-buffer-func buffer)
|
||||||
|
;; This can happen when this buffer was requested to be killed
|
||||||
|
;; from the minibuffer (e.g. with `ido-kill-buffer-at-head').
|
||||||
|
;; We have to exit the minibuffer first or there'll be a
|
||||||
|
;; "selecting deleted buffer" error.
|
||||||
|
(run-with-idle-timer 0 nil kill-buffer-func buffer)
|
||||||
|
(exit-minibuffer))))))
|
||||||
|
|
||||||
(defun exwm-manage--scan ()
|
(defun exwm-manage--scan ()
|
||||||
"Search for existing windows and try to manage them."
|
"Search for existing windows and try to manage them."
|
||||||
|
|
Loading…
Reference in a new issue