about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-09-09T03·26+0800
committerChris Feng <chris.w.feng@gmail.com>2015-09-09T03·26+0800
commit5373c1df1a8432f6a54e8ded8c9a145842c067e2 (patch)
tree16bc7e1e40bcbe2b1f058514f1a6b10dd12d48d9
parenteafd031c556ecfe986c656ca72fcde7e06ac819a (diff)
Add support for xcb:Atom:_NET_CLIENT_LIST_STACKING etc
The _NET_CLIENT_LIST_STACKING EWMH property is essential for e.g. the tabbar of
chromium to work correctly.

* exwm-input.el: Remove invalid TODO item.
* exwm.el (exwm--init-icccm-ewmh): Add xcb:Atom:_NET_CLIENT_LIST and
  xcb:Atom:_NET_CLIENT_LIST_STACKING to _NET_SUPPORTED.
* exwm-layout.el (exwm-layout--refresh): Update _NET_CLIENT_LIST_STACKING.
* exwm-manage.el (exwm-manage--manage-window, exwm-manage--unmanage-window):
  Update _NET_CLIENT_LIST.
-rw-r--r--exwm-input.el1
-rw-r--r--exwm-layout.el15
-rw-r--r--exwm-manage.el9
-rw-r--r--exwm.el2
4 files changed, 25 insertions, 2 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 69d2aff8e2..afa619b873 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -32,7 +32,6 @@
 ;; + Simulation keys to mimic Emacs key bindings for text edit (redo, select,
 ;;   cancel, clear, etc). Some of them are not present on common keyboard
 ;;   (keycode = 0). May need to use XKB extension.
-;; + Investigate DnD support (e.g. drag a chromium tab to another window).
 
 ;;; Code:
 
diff --git a/exwm-layout.el b/exwm-layout.el
index a14651a46d..ae1f48de8f 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -239,7 +239,20 @@
         (with-current-buffer (window-buffer window)
           (when (and (eq major-mode 'exwm-mode)
                      (or exwm--floating-frame (not (eq frame exwm--frame))))
-            (set-window-buffer window placeholder)))))))
+            (set-window-buffer window placeholder))))
+      ;; Update _NET_CLIENT_LIST_STACKING
+      (xcb:+request exwm--connection
+          (make-instance 'xcb:ewmh:set-_NET_CLIENT_LIST_STACKING
+                         :window exwm--root
+                         :data (vconcat
+                                (delq nil
+                                      (mapcar
+                                       (lambda (buffer)
+                                         (with-current-buffer buffer
+                                           (when (eq major-mode 'exwm-mode)
+                                             exwm--id)))
+                                       (buffer-list))))))
+      (xcb:flush exwm--connection))))
 
 (defun exwm-layout--on-minibuffer-setup ()
   "Refresh layout when minibuffer grows."
diff --git a/exwm-manage.el b/exwm-manage.el
index a8d0e592a8..2636c016b8 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -128,6 +128,10 @@ corresponding buffer.")
                          :cursor xcb:Cursor:None
                          :button xcb:ButtonIndex:Any
                          :modifiers xcb:ModMask:Any))
+      (xcb:+request exwm--connection    ;update _NET_CLIENT_LIST
+          (make-instance 'xcb:ewmh:set-_NET_CLIENT_LIST
+                         :window exwm--root
+                         :data (vconcat (mapcar #'car exwm--id-buffer-alist))))
       (xcb:flush exwm--connection)
       (exwm--update-title id)
       (exwm--update-transient-for id)
@@ -150,6 +154,11 @@ corresponding buffer.")
   (let ((buffer (exwm--id->buffer id)))
     (exwm--log "Unmanage #x%x (buffer: %s)" id buffer)
     (setq exwm--id-buffer-alist (assq-delete-all id exwm--id-buffer-alist))
+    (xcb:+request exwm--connection      ;update _NET_CLIENT_LIST
+        (make-instance 'xcb:ewmh:set-_NET_CLIENT_LIST
+                       :window exwm--root
+                       :data (vconcat (mapcar #'car exwm--id-buffer-alist))))
+    (xcb:flush exwm--connection)
     (when (buffer-live-p buffer)
       (with-current-buffer buffer
         (exwm-workspace--update-switch-history)
diff --git a/exwm.el b/exwm.el
index 84fbc15255..bf45e40c8b 100644
--- a/exwm.el
+++ b/exwm.el
@@ -417,6 +417,8 @@
       (make-instance 'xcb:ewmh:set-_NET_SUPPORTED
                      :window exwm--root
                      :data (vector xcb:Atom:_NET_SUPPORTED
+                                   xcb:Atom:_NET_CLIENT_LIST
+                                   xcb:Atom:_NET_CLIENT_LIST_STACKING
                                    xcb:Atom:_NET_NUMBER_OF_DESKTOPS
                                    xcb:Atom:_NET_DESKTOP_VIEWPORT
                                    xcb:Atom:_NET_CURRENT_DESKTOP