mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-27 13:07:59 +01:00
* exwm-manage.el (exwm-manage--scan): Check for possibly
destroyed child.
This commit is contained in:
parent
db5128c1b9
commit
6bd85db300
1 changed files with 16 additions and 9 deletions
|
@ -389,16 +389,23 @@ manager is shutting down."
|
|||
(defun exwm-manage--scan ()
|
||||
"Search for existing windows and try to manage them."
|
||||
(let* ((tree (xcb:+request-unchecked+reply exwm--connection
|
||||
(make-instance 'xcb:QueryTree :window exwm--root))))
|
||||
(make-instance 'xcb:QueryTree
|
||||
:window exwm--root)))
|
||||
reply)
|
||||
(dolist (i (slot-value tree 'children))
|
||||
(with-slots (override-redirect map-state)
|
||||
(xcb:+request-unchecked+reply exwm--connection
|
||||
(make-instance 'xcb:GetWindowAttributes :window i))
|
||||
(when (and (= 0 override-redirect) (= xcb:MapState:Viewable map-state))
|
||||
(xcb:+request exwm--connection
|
||||
(make-instance 'xcb:UnmapWindow :window i))
|
||||
(xcb:flush exwm--connection)
|
||||
(exwm-manage--manage-window i))))))
|
||||
(setq reply (xcb:+request-unchecked+reply exwm--connection
|
||||
(make-instance 'xcb:GetWindowAttributes
|
||||
:window i)))
|
||||
;; It's possible the X window has been destroyed.
|
||||
(when reply
|
||||
(with-slots (override-redirect map-state) reply
|
||||
(when (and (= 0 override-redirect)
|
||||
(= xcb:MapState:Viewable map-state))
|
||||
(xcb:+request exwm--connection
|
||||
(make-instance 'xcb:UnmapWindow
|
||||
:window i))
|
||||
(xcb:flush exwm--connection)
|
||||
(exwm-manage--manage-window i)))))))
|
||||
|
||||
(defvar exwm-manage--ping-lock nil
|
||||
"Non-nil indicates EXWM is pinging a window.")
|
||||
|
|
Loading…
Reference in a new issue