]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid dismissing GTK+ popup menus upon wheel movement
authorPo Lu <luangruo@yahoo.com>
Wed, 18 May 2022 06:55:23 +0000 (14:55 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 18 May 2022 06:56:04 +0000 (14:56 +0800)
* 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

index c24de0f185f680e64d397d4cfecb277109279bc3..b5fbb474ecc015781fb623ebe64731bf05e2df59 100644 (file)
@@ -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