diff options
| author | Po Lu | 2022-01-10 11:29:35 +0800 |
|---|---|---|
| committer | Po Lu | 2022-01-10 11:31:41 +0800 |
| commit | 697298e7451a5d60c8d89c4c3c931eb07c688c6a (patch) | |
| tree | 1765722514043b03a548d302ac1c495fa4b06d51 /src | |
| parent | 3057e0458f247c9d7bf43b27087c0abcf8aff4b3 (diff) | |
| download | emacs-697298e7451a5d60c8d89c4c3c931eb07c688c6a.tar.gz emacs-697298e7451a5d60c8d89c4c3c931eb07c688c6a.zip | |
Make toggling native input methods via shift work again
* src/xterm.c (handle_one_xevent): Start filtering XI key
release events again, but drop the event if the IM asked.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 5e4941a4aed..712792674f2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11110,6 +11110,37 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 11110 | } | 11110 | } |
| 11111 | case XI_KeyRelease: | 11111 | case XI_KeyRelease: |
| 11112 | x_display_set_last_user_time (dpyinfo, xev->time); | 11112 | x_display_set_last_user_time (dpyinfo, xev->time); |
| 11113 | |||
| 11114 | #if defined HAVE_X_I18N || defined USE_GTK | ||
| 11115 | XKeyPressedEvent xkey; | ||
| 11116 | |||
| 11117 | memset (&xkey, 0, sizeof xkey); | ||
| 11118 | |||
| 11119 | xkey.type = KeyRelease; | ||
| 11120 | xkey.serial = xev->serial; | ||
| 11121 | xkey.send_event = xev->send_event; | ||
| 11122 | xkey.display = xev->display; | ||
| 11123 | xkey.window = xev->event; | ||
| 11124 | xkey.root = xev->root; | ||
| 11125 | xkey.subwindow = xev->child; | ||
| 11126 | xkey.time = xev->time; | ||
| 11127 | xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) | ||
| 11128 | | (xev->group.effective << 13)); | ||
| 11129 | xkey.keycode = xev->detail; | ||
| 11130 | xkey.same_screen = True; | ||
| 11131 | |||
| 11132 | #ifdef HAVE_X_I18N | ||
| 11133 | if (x_filter_event (dpyinfo, (XEvent *) &xkey)) | ||
| 11134 | *finish = X_EVENT_DROP; | ||
| 11135 | #else | ||
| 11136 | f = x_any_window_to_frame (xkey->event); | ||
| 11137 | |||
| 11138 | if (f && | ||
| 11139 | xg_filter_event (dpyinfo, event)) | ||
| 11140 | *finish = X_EVENT_DROP; | ||
| 11141 | #endif | ||
| 11142 | #endif | ||
| 11143 | |||
| 11113 | goto XI_OTHER; | 11144 | goto XI_OTHER; |
| 11114 | 11145 | ||
| 11115 | case XI_PropertyEvent: | 11146 | case XI_PropertyEvent: |