From 4a845b2cd0e771b39b778daf4941e5c02fa8e6b8 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 10 Mar 2022 09:16:39 +0800 Subject: [PATCH] Fix stray button release events being reported on GTK 2 * src/xterm.c (handle_one_xevent): Drop ButtonRelease events that are destined for a popup menu. --- src/xterm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 0d77ea0c198..5b1e1023799 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12435,6 +12435,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, g_object_ref (copy->button.window); + if (popup_activated () + && xev->evtype == XI_ButtonRelease) + { + *finish = X_EVENT_DROP; + gtk_main_do_event (copy); + gdk_event_free (copy); + goto XI_OTHER; + } + gtk_main_do_event (copy); gdk_event_free (copy); #endif -- 2.39.2