mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-27 13:07:59 +01:00
Remove redundant code caused by the concurrency of events
With the introduction of ch11ng/xelb@6a7bccc, many weird behaviors should disappear. These include by not limit to * race conditions when managing a window (a workaround is provided in @14628a9) * race conditions when unmanaging a window This commit removes some corresponding code.
This commit is contained in:
parent
36bb5793c2
commit
edc70eb661
1 changed files with 1 additions and 10 deletions
|
@ -42,30 +42,21 @@ corresponding buffer.")
|
||||||
(when reply ;nil when destroyed
|
(when reply ;nil when destroyed
|
||||||
(setq exwm--geometry reply))))))
|
(setq exwm--geometry reply))))))
|
||||||
|
|
||||||
(defvar exwm-manage--manage-window-queue nil
|
|
||||||
"List of window IDs to prevent race conditions.")
|
|
||||||
|
|
||||||
(defun exwm-manage--manage-window (id)
|
(defun exwm-manage--manage-window (id)
|
||||||
"Manage window ID."
|
"Manage window ID."
|
||||||
(exwm--log "Try to manage #x%x" id)
|
(exwm--log "Try to manage #x%x" id)
|
||||||
(setq exwm-input--focus-lock t)
|
(setq exwm-input--focus-lock t)
|
||||||
(catch 'return
|
(catch 'return
|
||||||
;; Ensure it's not managed
|
;; Ensure it's not managed
|
||||||
(when (or (assoc id exwm--id-buffer-alist)
|
(when (assoc id exwm--id-buffer-alist)
|
||||||
(memq id exwm-manage--manage-window-queue))
|
|
||||||
(exwm--log "#x%x is already managed" id)
|
(exwm--log "#x%x is already managed" id)
|
||||||
(throw 'return 'managed))
|
(throw 'return 'managed))
|
||||||
(push id exwm-manage--manage-window-queue) ;prevent reentering
|
|
||||||
;; Ensure it's alive
|
;; Ensure it's alive
|
||||||
(when (xcb:+request-checked+request-check exwm--connection
|
(when (xcb:+request-checked+request-check exwm--connection
|
||||||
(make-instance 'xcb:ChangeWindowAttributes
|
(make-instance 'xcb:ChangeWindowAttributes
|
||||||
:window id :value-mask xcb:CW:EventMask
|
:window id :value-mask xcb:CW:EventMask
|
||||||
:event-mask exwm--client-event-mask))
|
:event-mask exwm--client-event-mask))
|
||||||
(setq exwm-manage--manage-window-queue
|
|
||||||
(delq id exwm-manage--manage-window-queue)) ;cleanup
|
|
||||||
(throw 'return 'dead))
|
(throw 'return 'dead))
|
||||||
(setq exwm-manage--manage-window-queue
|
|
||||||
(delq id exwm-manage--manage-window-queue)) ;cleanup (late enough)
|
|
||||||
(with-current-buffer (generate-new-buffer "*EXWM*")
|
(with-current-buffer (generate-new-buffer "*EXWM*")
|
||||||
(push `(,id . ,(current-buffer)) exwm--id-buffer-alist)
|
(push `(,id . ,(current-buffer)) exwm--id-buffer-alist)
|
||||||
(exwm-mode)
|
(exwm-mode)
|
||||||
|
|
Loading…
Reference in a new issue