about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-04-23T15·39+0800
committerChris Feng <chris.w.feng@gmail.com>2017-04-23T15·39+0800
commit2b7449ea425df236471496cd96f061d70f3ba15a (patch)
tree257579378fcaeb5479fa95b4f2b1ead33344ecce /exwm-input.el
parentd4cfa564be680cec3fe1372e3bc9b29834e0d98a (diff)
; Do not cache events for non-`exwm-mode' buffers
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 54b5f30ff1e2..b602a92561d0 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -494,10 +494,12 @@ This value should always be overwritten.")
                  (setq event (xcb:keysyms:keysym->event
                               exwm--connection (car keysym)
                               (logand state (lognot (cdr keysym))))))
-        (when (eq major-mode 'exwm-mode)
+        (if (not (eq major-mode 'exwm-mode))
+            (exwm-input--unread-event event)
+          ;; Grab keyboard temporarily.
           (setq exwm-input--temp-line-mode t)
-          (exwm-input--grab-keyboard))  ;grab keyboard temporarily
-        (exwm-input--cache-event event))))
+          (exwm-input--grab-keyboard)
+          (exwm-input--cache-event event)))))
   (xcb:+request exwm--connection
       (make-instance 'xcb:AllowEvents
                      :mode xcb:Allow:AsyncKeyboard