From d9b4ba0265fc1674b1205a11e838f86bce434b13 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Thu, 29 Oct 2015 12:22:00 +0800 Subject: Avoid mapping managed X windows on MapRequest * exwm-manage.el (exwm-manage--manage-window, exwm-manage--on-MapRequest): Check managed X windows in exwm-manage--on-MapRequest instead. --- exwm-manage.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'exwm-manage.el') diff --git a/exwm-manage.el b/exwm-manage.el index 0eed8b9fd7..bf285ab944 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -63,10 +63,6 @@ corresponding buffer.") "Manage window ID." (exwm--log "Try to manage #x%x" id) (catch 'return - ;; Ensure it's not managed - (when (assoc id exwm--id-buffer-alist) - (exwm--log "#x%x is already managed" id) - (throw 'return 'managed)) ;; Ensure it's alive (when (xcb:+request-checked+request-check exwm--connection (make-instance 'xcb:ChangeWindowAttributes @@ -363,12 +359,14 @@ corresponding buffer.") (let ((obj (make-instance 'xcb:MapRequest))) (xcb:unmarshal obj data) (with-slots (parent window) obj - (if (/= exwm--root parent) - (progn (xcb:+request exwm--connection - (make-instance 'xcb:MapWindow :window window)) - (xcb:flush exwm--connection)) - (exwm--log "MapRequest from #x%x" window) - (exwm-manage--manage-window window))))) + (if (assoc window exwm--id-buffer-alist) + (exwm--log "#x%x is already managed" id) + (if (/= exwm--root parent) + (progn (xcb:+request exwm--connection + (make-instance 'xcb:MapWindow :window window)) + (xcb:flush exwm--connection)) + (exwm--log "MapRequest from #x%x" window) + (exwm-manage--manage-window window)))))) (defun exwm-manage--on-UnmapNotify (data synthetic) "Handle UnmapNotify event." -- cgit 1.4.1