From 9845f6b9aa6e5ea0b272987bbf629d3eb4dc0531 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 15 Jan 2022 09:40:28 +0800 Subject: [PATCH] Fix native input when using core input events * src/gtkutil.c (xg_filter_key): Test for core key press events correctly. * src/xterm.c (handle_one_xevent): Also check for KeyRelease events. --- src/gtkutil.c | 2 +- src/xterm.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gtkutil.c b/src/gtkutil.c index 36ed55bc039..d17a6970b8d 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -6262,7 +6262,7 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event, bool xg_filter_key (struct frame *frame, XEvent *xkey) { - GdkEvent *xg_event = gdk_event_new ((xkey->type == ButtonPress + GdkEvent *xg_event = gdk_event_new ((xkey->type == KeyPress #ifdef HAVE_XINPUT2 || (xkey->type == GenericEvent && xkey->xgeneric.evtype == XI_KeyPress) diff --git a/src/xterm.c b/src/xterm.c index 103eb75a460..0e93c992751 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8373,6 +8373,7 @@ x_filter_event (struct x_display_info *dpyinfo, XEvent *event) #ifdef USE_GTK } else if (f1 && (event->type == KeyPress + || event->type == KeyRelease #ifdef HAVE_XINPUT2 || xinput_event #endif -- 2.39.2