From 94f342438144c99bec90cc219283df2033866576 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 9 Mar 2022 21:33:48 +0800 Subject: [PATCH] Fix some issues with GTK native input and modifiers on GTK 2 * src/gtkutil.c (xg_widget_key_press_event_cb): Manually ignore modifier keys on GTK 2. --- src/gtkutil.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gtkutil.c b/src/gtkutil.c index 4f9907f795a..bf95c966421 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -6252,6 +6252,13 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event, if (event->key.is_modifier) goto done; +#ifndef HAVE_GTK3 + /* FIXME: event->key.is_modifier is not accurate on GTK 2. */ + + if (keysym >= GDK_KEY_Shift_L && keysym <= GDK_KEY_Hyper_R) + goto done; +#endif + /* First deal with keysyms which have defined translations to characters. */ if (keysym >= 32 && keysym < 128) -- 2.39.2