about summary refs log tree commit diff
path: root/exwm-xim.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2019-08-05T00·00+0000
committerChris Feng <chris.w.feng@gmail.com>2019-08-05T00·00+0000
commit37098a400994948fe99a2bb944fc2c66e0c71b6a (patch)
tree5b9e13239f710a9db77bb3fec87cfdae517aa057 /exwm-xim.el
parent2c0dcc46cdf4a51aa7f082492290d9fb5a3537bf (diff)
Fix detection of modifier keys in Emacs events
* exwm-input.el (exwm-input--grab-global-prefix-keys)
(exwm-input--fake-key):
* exwm-xim.el (exwm-xim--handle-forward-event-request): X11 allows
multiple combinations of KEYSYM-MODIFIERS to generate a same
KEYSYM, thus the result of an Emacs event to KEYSYM-MODIFIERS
conversion is not necessarily unique.  Previously the result of
`xcb:keysyms:event->keysym' is misused as the modifiers returned is
actually the ones should be consumed.
Diffstat (limited to 'exwm-xim.el')
-rw-r--r--exwm-xim.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/exwm-xim.el b/exwm-xim.el
index 344f8c64cd..dc22f82fc4 100644
--- a/exwm-xim.el
+++ b/exwm-xim.el
@@ -530,7 +530,7 @@ The actual XIM request is in client message data or a property."
 (defun exwm-xim--handle-forward-event-request (req lsb conn client-xwin)
   (let ((im-func (with-current-buffer (window-buffer)
                    input-method-function))
-        key-event keysym event result)
+        key-event keysym keysyms event result)
     ;; Note: The flag slot is ignored.
     ;; Do conversion in client's byte-order.
     (let ((xcb:lsb lsb))
@@ -564,11 +564,11 @@ The actual XIM request is in client message data or a property."
               req
             (if raw-event
                 (setq event raw-event)
-              (setq keysym (xcb:keysyms:event->keysym exwm-xim--conn event))
+              (setq keysyms (xcb:keysyms:event->keysyms exwm-xim--conn event))
               (with-slots (detail state) key-event
                 (setf detail (xcb:keysyms:keysym->keycode exwm-xim--conn
-                                                          (car keysym))
-                      state (cdr keysym)))
+                                                          (caar keysyms))
+                      state (cdar keysyms)))
               (setq event (let ((xcb:lsb lsb))
                             (xcb:marshal key-event conn))))
             (when event