about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-08-24T11·01+0800
committerChris Feng <chris.w.feng@gmail.com>2015-08-24T11·01+0800
commit5210e13e7c95d0d8f94c657efa13e71fad4ef818 (patch)
tree120e29cfc7ec773eda0a027d1a8e7c9447babe76
parent5882015eb5a21cb859794388e21d6dc023764480 (diff)
Only manage windows mapped as the direct children of root window (close #38)
Sometimes Emacs create child windows of virtual roots. This commit ensures EXWM
will not manage them.
-rw-r--r--exwm-manage.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/exwm-manage.el b/exwm-manage.el
index 3274d65c177a..0fde4d40611a 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -278,7 +278,7 @@ corresponding buffer.")
                             value-mask)
         obj
       (exwm--log "ConfigureRequest from #x%x (#x%x) @%dx%d%+d%+d, border: %d"
-                 value-mask window width height x y border-width)
+                 window value-mask width height x y border-width)
       (if (setq buffer (exwm--id->buffer window))
           ;; Send client message for managed windows
           (with-current-buffer buffer
@@ -320,8 +320,13 @@ corresponding buffer.")
   "Handle MapRequest event."
   (let ((obj (make-instance 'xcb:MapRequest)))
     (xcb:unmarshal obj data)
-    (exwm--log "MapRequest from #x%x" (slot-value obj 'window))
-    (exwm-manage--manage-window (slot-value obj 'window))))
+    (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)))))
 
 (defun exwm-manage--on-UnmapNotify (data synthetic)
   "Handle UnmapNotify event."