about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-02-20T14·21+0800
committerChris Feng <chris.w.feng@gmail.com>2018-02-20T14·24+0800
commit86f2215be3db25a6b6aacd6f8b0cb132b049e034 (patch)
treef13e586d097a075b18c8ad5d9db1babe5c6f325a /exwm-input.el
parentc821f76dfef9d7592b263f8fea789b6da7fbddf4 (diff)
Fix unexpected focus change after a global key binding is activated
* exwm-core.el (exwm--unlock): Select FocusChange events on the root
window.

* exwm-input.el (exwm-input--on-FocusIn): Input focus should stay on
the current workspace when the root window receives a FocusIn event.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 73a0dba6f2..8102eb2ca7 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -218,10 +218,9 @@ ARGS are additional arguments to CALLBACK."
     (xcb:unmarshal obj data)
     (with-slots (mode) obj
       ;; Revert input focus back to Emacs frame / X window when it's set on
-      ;; the root window or some workspace container.
-      (when (eq mode xcb:NotifyMode:Normal)
-        (x-focus-frame (selected-frame))
-        (select-window (selected-window))))))
+      ;; the root window.
+      (x-focus-frame exwm-workspace--current)
+      (select-window (frame-selected-window exwm-workspace--current)))))
 
 (defun exwm-input--on-EnterNotify (data _synthetic)
   "Handle EnterNotify events."