about summary refs log tree commit diff
path: root/exwm-manage.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-08-08T00·29+0800
committerChris Feng <chris.w.feng@gmail.com>2015-08-08T00·29+0800
commit3b9d0dd9217add078415ecda644b5cd19632f1fc (patch)
tree90e78b9f3bebf3365d4f46776b28ef491295cedc /exwm-manage.el
parent14628a940c12051f2538556b97a2ef4531c75201 (diff)
Fixes for manage/unmanage window
* Make sure `exwm-manage--manage-window-queue` is cleaned
* Improve input focus handling after unmanaging a window
* Remove a redundant call to `exwm-layout--show`
Diffstat (limited to 'exwm-manage.el')
-rw-r--r--exwm-manage.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/exwm-manage.el b/exwm-manage.el
index 8594066a71fa..8bf118e2f0ee 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -61,9 +61,11 @@ corresponding buffer.")
               (make-instance 'xcb:ChangeWindowAttributes
                              :window id :value-mask xcb:CW:EventMask
                              :event-mask exwm--client-event-mask))
-      (delq id exwm-manage--manage-window-queue) ;cleanup
+      (setq exwm-manage--manage-window-queue
+            (delq id exwm-manage--manage-window-queue)) ;cleanup
       (throw 'return 'dead))
-    (delq id exwm-manage--manage-window-queue) ;cleanup (late enough)
+    (setq exwm-manage--manage-window-queue
+          (delq id exwm-manage--manage-window-queue)) ;cleanup (late enough)
     (with-current-buffer (generate-new-buffer "*EXWM*")
       (push `(,id . ,(current-buffer)) exwm--id-buffer-alist)
       (exwm-mode)
@@ -193,7 +195,15 @@ corresponding buffer.")
         (let ((floating exwm--floating-frame))
           (kill-buffer)
           (when floating
-            (select-frame-set-input-focus exwm-workspace--current)))))))
+            (if (eq 'exwm-mode
+                    (with-current-buffer
+                        (window-buffer
+                         (frame-first-window exwm-workspace--current))
+                      major-mode))
+                ;; Input focus is to be set on a window
+                (x-focus-frame exwm-workspace--current)
+              ;; Set input focus on a frame
+              (select-frame-set-input-focus exwm-workspace--current))))))))
 
 (defun exwm-manage--scan ()
   "Search for existing windows and try to manage them."