about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2019-09-22T00·00+0000
committerChris Feng <chris.w.feng@gmail.com>2019-09-22T00·00+0000
commit2005fa5c5dcfdcc49e1ce0b631a1793e9c25604f (patch)
tree2cba105f690dd54303a7b066f6381154db0522d1 /exwm.el
parent9c85f172e5697f85bdea67ef8b23819448abd31a (diff)
Make _NET_ACTIVE_WINDOW working for floating X windows
* exwm.el (exwm--on-ClientMessage): Select floating frames for
floating X windows on receiving _NET_ACTIVE_WINDOW.
Diffstat (limited to 'exwm.el')
-rw-r--r--exwm.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/exwm.el b/exwm.el
index e5b603e02513..36dbcb677f13 100644
--- a/exwm.el
+++ b/exwm.el
@@ -446,16 +446,18 @@
         (when (buffer-live-p buffer)
           (with-current-buffer buffer
             (when (eq exwm--frame exwm-workspace--current)
-              (setq iconic (exwm-layout--iconic-state-p))
-              (when iconic
-                ;; State change: iconic => normal.
-                (set-window-buffer (frame-selected-window exwm--frame)
-                                   (current-buffer)))
-              ;; Focus transfer.
-              (setq window (get-buffer-window nil t))
-              (when (or iconic
-                        (not (eq window (selected-window))))
-                (select-window window)))))))
+              (if exwm--floating-frame
+                  (select-frame exwm--floating-frame)
+                (setq iconic (exwm-layout--iconic-state-p))
+                (when iconic
+                  ;; State change: iconic => normal.
+                  (set-window-buffer (frame-selected-window exwm--frame)
+                                     (current-buffer)))
+                ;; Focus transfer.
+                (setq window (get-buffer-window nil t))
+                (when (or iconic
+                          (not (eq window (selected-window))))
+                  (select-window window))))))))
      ;; _NET_CLOSE_WINDOW.
      ((= type xcb:Atom:_NET_CLOSE_WINDOW)
       (let ((buffer (exwm--id->buffer id)))