about summary refs log tree commit diff
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
commit9bea3c9bcd02dc2647881feaaacbf71f6c25ff64 (patch)
treeec964f150a6355c0156acf95f12cec9b2df94518
parent2005fa5c5dcfdcc49e1ce0b631a1793e9c25604f (diff)
Make input focus continue to work after EXWM exits
* exwm-input.el (exwm-input--exit): Set input focus 'revert-to' to
'PointerRoot' so that user can set input focus to X windows with
pointer after EXWM exits (and there's no other WM).
-rw-r--r--exwm-input.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/exwm-input.el b/exwm-input.el
index c5eedc9e1d69..c8cf01817cfd 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -1147,7 +1147,14 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
   (when exwm-input--update-focus-defer-timer
     (cancel-timer exwm-input--update-focus-defer-timer))
   (when exwm-input--update-focus-timer
-    (cancel-timer exwm-input--update-focus-timer)))
+    (cancel-timer exwm-input--update-focus-timer))
+  ;; Make input focus working even without a WM.
+  (xcb:+request exwm--connection
+      (make-instance 'xcb:SetInputFocus
+                     :revert-to xcb:InputFocus:PointerRoot
+                     :focus exwm--root
+                     :time xcb:Time:CurrentTime))
+  (xcb:flush exwm--connection))