]> git.eshelyaron.com Git - emacs.git/commitdiff
Make toggling native input methods via shift work again
authorPo Lu <luangruo@yahoo.com>
Mon, 10 Jan 2022 03:29:35 +0000 (11:29 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 10 Jan 2022 03:31:41 +0000 (11:31 +0800)
* src/xterm.c (handle_one_xevent): Start filtering XI key
release events again, but drop the event if the IM asked.

src/xterm.c

index 5e4941a4aedf14d7ec15d2c6b4114326d98ff91d..712792674f25ffc8f3e55a4b39d9b82845976c2e 100644 (file)
@@ -11110,6 +11110,37 @@ handle_one_xevent (struct x_display_info *dpyinfo,
            }
          case XI_KeyRelease:
            x_display_set_last_user_time (dpyinfo, xev->time);
+
+#if defined HAVE_X_I18N || defined USE_GTK
+             XKeyPressedEvent xkey;
+
+             memset (&xkey, 0, sizeof xkey);
+
+             xkey.type = KeyRelease;
+             xkey.serial = xev->serial;
+             xkey.send_event = xev->send_event;
+             xkey.display = xev->display;
+             xkey.window = xev->event;
+             xkey.root = xev->root;
+             xkey.subwindow = xev->child;
+             xkey.time = xev->time;
+             xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14))
+                           | (xev->group.effective << 13));
+             xkey.keycode = xev->detail;
+             xkey.same_screen = True;
+
+#ifdef HAVE_X_I18N
+             if (x_filter_event (dpyinfo, (XEvent *) &xkey))
+               *finish = X_EVENT_DROP;
+#else
+             f = x_any_window_to_frame (xkey->event);
+
+             if (f &&
+                 xg_filter_event (dpyinfo, event))
+               *finish = X_EVENT_DROP;
+#endif
+#endif
+
            goto XI_OTHER;
 
          case XI_PropertyEvent: