From 997ce9eb3d65089f4d924c7e5377f1b3bf0c2c13 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 18 May 2022 14:55:23 +0800 Subject: [PATCH] Avoid dismissing GTK+ popup menus upon wheel movement * src/xterm.c (handle_one_xevent): Don't forward XI button events for wheel buttons to GTK+ when a popup menu is active. --- src/xterm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index c24de0f185f..b5fbb474ecc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -18328,9 +18328,17 @@ handle_one_xevent (struct x_display_info *dpyinfo, g_object_ref (copy->button.window); - if (popup_activated () - && xev->evtype == XI_ButtonRelease) - goto XI_OTHER; + if (popup_activated ()) + { + /* GTK+ popup menus don't respond to core buttons + after Button3, so don't dismiss popup menus upon + wheel movement here either. */ + if (xev->detail > 3) + *finish = X_EVENT_DROP; + + if (xev->evtype == XI_ButtonRelease) + goto XI_OTHER; + } #endif #ifdef HAVE_XINPUT2_1 -- 2.39.2