mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-30 16:07:59 +01:00
Fix a lock issue with _NET_CLOSE_WINDOW and WM_DELETE_WINDOW
* exwm.el (exwm--on-ClientMessage): Calling `kill-buffer' directly from an event context won't work since the DestroyNotify event for a WM_DELETE_WINDOW request won't be handled until the current event context terminates. * exwm-manage.el (exwm-manage--kill-buffer-query-function): Avoid potential side effects with MapWindow.
This commit is contained in:
parent
5b9f4b0851
commit
5505cff826
2 changed files with 7 additions and 4 deletions
|
@ -513,8 +513,10 @@ manager is shutting down."
|
||||||
(catch 'return
|
(catch 'return
|
||||||
(when (or (not exwm--id)
|
(when (or (not exwm--id)
|
||||||
(xcb:+request-checked+request-check exwm--connection
|
(xcb:+request-checked+request-check exwm--connection
|
||||||
(make-instance 'xcb:MapWindow
|
(make-instance 'xcb:ChangeWindowAttributes
|
||||||
:window exwm--id)))
|
:window exwm--id
|
||||||
|
:value-mask xcb:CW:EventMask
|
||||||
|
:event-mask (exwm--get-client-event-mask))))
|
||||||
;; The X window is no longer alive so just close the buffer.
|
;; The X window is no longer alive so just close the buffer.
|
||||||
(when exwm--floating-frame
|
(when exwm--floating-frame
|
||||||
(let ((window (frame-parameter exwm--floating-frame 'exwm-outer-id))
|
(let ((window (frame-parameter exwm--floating-frame 'exwm-outer-id))
|
||||||
|
|
5
exwm.el
5
exwm.el
|
@ -420,7 +420,8 @@
|
||||||
(setq type (slot-value obj 'type)
|
(setq type (slot-value obj 'type)
|
||||||
id (slot-value obj 'window)
|
id (slot-value obj 'window)
|
||||||
data (slot-value (slot-value obj 'data) 'data32))
|
data (slot-value (slot-value obj 'data) 'data32))
|
||||||
(exwm--log "atom=%s(%s)" (x-get-atom-name type exwm-workspace--current) type)
|
(exwm--log "atom=%s(%s)" (x-get-atom-name type exwm-workspace--current)
|
||||||
|
type)
|
||||||
(cond
|
(cond
|
||||||
;; _NET_NUMBER_OF_DESKTOPS.
|
;; _NET_NUMBER_OF_DESKTOPS.
|
||||||
((= type xcb:Atom:_NET_NUMBER_OF_DESKTOPS)
|
((= type xcb:Atom:_NET_NUMBER_OF_DESKTOPS)
|
||||||
|
@ -459,7 +460,7 @@
|
||||||
((= type xcb:Atom:_NET_CLOSE_WINDOW)
|
((= type xcb:Atom:_NET_CLOSE_WINDOW)
|
||||||
(let ((buffer (exwm--id->buffer id)))
|
(let ((buffer (exwm--id->buffer id)))
|
||||||
(when (buffer-live-p buffer)
|
(when (buffer-live-p buffer)
|
||||||
(kill-buffer buffer))))
|
(exwm--defer 0 #'kill-buffer buffer))))
|
||||||
;; _NET_WM_MOVERESIZE
|
;; _NET_WM_MOVERESIZE
|
||||||
((= type xcb:Atom:_NET_WM_MOVERESIZE)
|
((= type xcb:Atom:_NET_WM_MOVERESIZE)
|
||||||
(let ((direction (elt data 2))
|
(let ((direction (elt data 2))
|
||||||
|
|
Loading…
Reference in a new issue