emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4d2aa420bd: Fix core string lookup with modifiers on XI2


From: Po Lu
Subject: master 4d2aa420bd: Fix core string lookup with modifiers on XI2
Date: Fri, 15 Apr 2022 03:09:59 -0400 (EDT)

branch: master
commit 4d2aa420bd09ac5109a4c13bd163386ea276297e
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix core string lookup with modifiers on XI2
    
    * src/xterm.c (handle_one_xevent): Clean modifiers from
    xkey.state before giving it to XLookupString.
---
 src/xterm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 289ea06d92..f80b2ad2f0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17535,6 +17535,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              char *copy_bufptr = copy_buffer;
              int copy_bufsiz = sizeof (copy_buffer);
              ptrdiff_t i;
+             uint old_state;
              struct xi_device_t *device, *source;
 
              coding = Qlatin_1;
@@ -17779,9 +17780,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                      else
 #endif
                        {
+                         old_state = xkey.state;
+                         xkey.state &= ~ControlMask;
+                         xkey.state &= ~(dpyinfo->meta_mod_mask
+                                         | dpyinfo->super_mod_mask
+                                         | dpyinfo->hyper_mod_mask
+                                         | dpyinfo->alt_mod_mask);
+
                          nbytes = XLookupString (&xkey, copy_bufptr,
                                                  copy_bufsiz, &keysym,
                                                  NULL);
+
+                         xkey.state = old_state;
                        }
                    }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]