aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-04-15 15:09:18 +0800
committerPo Lu2022-04-15 15:09:18 +0800
commit4d2aa420bd09ac5109a4c13bd163386ea276297e (patch)
treec3f13324d774a9e19d4451a7d031a7fa36a14b93 /src
parent095a776d0642bced88a6357f2d889c8980e0b83a (diff)
downloademacs-4d2aa420bd09ac5109a4c13bd163386ea276297e.tar.gz
emacs-4d2aa420bd09ac5109a4c13bd163386ea276297e.zip
Fix core string lookup with modifiers on XI2
* src/xterm.c (handle_one_xevent): Clean modifiers from xkey.state before giving it to XLookupString.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 289ea06d929..f80b2ad2f02 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17535,6 +17535,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
17535 char *copy_bufptr = copy_buffer; 17535 char *copy_bufptr = copy_buffer;
17536 int copy_bufsiz = sizeof (copy_buffer); 17536 int copy_bufsiz = sizeof (copy_buffer);
17537 ptrdiff_t i; 17537 ptrdiff_t i;
17538 uint old_state;
17538 struct xi_device_t *device, *source; 17539 struct xi_device_t *device, *source;
17539 17540
17540 coding = Qlatin_1; 17541 coding = Qlatin_1;
@@ -17779,9 +17780,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
17779 else 17780 else
17780#endif 17781#endif
17781 { 17782 {
17783 old_state = xkey.state;
17784 xkey.state &= ~ControlMask;
17785 xkey.state &= ~(dpyinfo->meta_mod_mask
17786 | dpyinfo->super_mod_mask
17787 | dpyinfo->hyper_mod_mask
17788 | dpyinfo->alt_mod_mask);
17789
17782 nbytes = XLookupString (&xkey, copy_bufptr, 17790 nbytes = XLookupString (&xkey, copy_bufptr,
17783 copy_bufsiz, &keysym, 17791 copy_bufsiz, &keysym,
17784 NULL); 17792 NULL);
17793
17794 xkey.state = old_state;
17785 } 17795 }
17786 } 17796 }
17787 17797