about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--exwm-core.el3
-rw-r--r--exwm-input.el7
2 files changed, 5 insertions, 5 deletions
diff --git a/exwm-core.el b/exwm-core.el
index 41c3b5772495..f64a7f25fa31 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -93,7 +93,8 @@
                      :window exwm--root
                      :value-mask xcb:CW:EventMask
                      :event-mask (eval-when-compile
-                                   (logior xcb:EventMask:SubstructureRedirect
+                                   (logior xcb:EventMask:FocusChange
+                                           xcb:EventMask:SubstructureRedirect
                                            xcb:EventMask:StructureNotify))))
   (xcb:flush exwm--connection))
 
diff --git a/exwm-input.el b/exwm-input.el
index 73a0dba6f22e..8102eb2ca79f 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."