about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2023-06-14T00·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2023-06-14T00·00+0000
commitb100eb74c520e5db1e27db475af8464a236efecb (patch)
treefda2ceef37cd5e93596410213c323306e14128d0 /exwm-input.el
parenta417f0d45e73f75028ba17ae49c664e3548deeba (diff)
parent7318f857f2937c421094d66d976d4e926feacc71 (diff)
Merge branch 'nbarrientos.github.com/ib_exwm_conn_nil' into externals/exwm
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/exwm-input.el b/exwm-input.el
index ab22d60a38..30ae89353e 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -1218,12 +1218,13 @@ One use is to access the keymap bound to KEYS (as prefix keys) in char-mode."
   (when 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))
+  (when (slot-value exwm--connection 'connected)
+    (xcb:+request exwm--connection
+        (make-instance 'xcb:SetInputFocus
+                       :revert-to xcb:InputFocus:PointerRoot
+                       :focus exwm--root
+                       :time xcb:Time:CurrentTime))
+    (xcb:flush exwm--connection)))