branch: externals/exwm
commit 52984898ec8d59fe42e86a311c7e7dbeec95c611
Author: Chris Feng <chris.w.f...@gmail.com>
Commit: Chris Feng <chris.w.f...@gmail.com>

    Fix some input focus issues
    
    * Fix input focus lost after moving window to another workspace
    * Enhance `exwm-reset` to provide user a way to reset input focus when it's
      lost unexpectedly
---
 exwm-workspace.el |   13 ++++++++-----
 exwm.el           |    3 +++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index da3f9ce..efecf57 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -181,14 +181,17 @@ The optional FORCE option is for internal use only."
         (if exwm--floating-frame
             ;; Move the floating frame is enough
             (xcb:+request exwm--connection
-            (make-instance 'xcb:ReparentWindow
-                           :window (frame-parameter exwm--floating-frame
-                                                    'exwm-outer-id)
-                           :parent (frame-parameter frame 'exwm-window-id)
-                           :x 0 :y 0))
+                (make-instance 'xcb:ReparentWindow
+                               :window (frame-parameter exwm--floating-frame
+                                                        'exwm-outer-id)
+                               :parent (frame-parameter frame 'exwm-window-id)
+                               :x 0 :y 0))
           ;; Move the window itself
           (bury-buffer)
           (exwm-layout--hide id)
+          ;; Force update input focus
+          (setq exwm-input--focus-id xcb:Window:None)
+          (exwm-input--update-focus)
           (xcb:+request exwm--connection
               (make-instance 'xcb:ReparentWindow
                              :window id
diff --git a/exwm.el b/exwm.el
index 88d7674..984f8ee 100644
--- a/exwm.el
+++ b/exwm.el
@@ -198,6 +198,9 @@
   (with-current-buffer (window-buffer)
     (when (eq major-mode 'exwm-mode)
       (when exwm--fullscreen (exwm-layout-unset-fullscreen))
+      ;; Force update input focus
+      (setq exwm-input--focus-id xcb:Window:None)
+      (exwm-input--update-focus)
       (exwm-input-grab-keyboard))))
 
 (defmacro exwm--with-current-id (id &rest body)

Reply via email to