]> git.eshelyaron.com Git - emacs.git/commitdiff
Ignore XI_TouchBegin events on the GTK tool bar
authorPo Lu <luangruo@yahoo.com>
Tue, 21 Dec 2021 06:58:44 +0000 (14:58 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 21 Dec 2021 07:00:08 +0000 (15:00 +0800)
* src/xterm.c (handle_one_xevent): Ignore TouchBegin events
that target the tool bar.

src/xterm.c

index 1dc68220f08ec62bcae4b48450b0d152dea360b4..57c5616f95f6048b01eaea759f625bfa100dc599 100644 (file)
@@ -10878,7 +10878,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          case XI_TouchBegin:
            {
              struct xi_device_t *device;
-             bool menu_bar_p = false;
+             bool menu_bar_p = false, tool_bar_p = false;
+#ifdef HAVE_GTK3
+             GdkRectangle test_rect;
+#endif
              device = xi_device_from_id (dpyinfo, xev->deviceid);
              x_display_set_last_user_time (dpyinfo, xev->time);
 
@@ -10893,9 +10896,19 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #ifdef HAVE_GTK3
              menu_bar_p = (f && FRAME_X_OUTPUT (f)->menubar_widget
                            && xg_event_is_for_menubar (f, event));
+             if (f && FRAME_X_OUTPUT (f)->toolbar_widget)
+               {
+                 test_rect.x = xev->event_x;
+                 test_rect.y = xev->event_x;
+                 test_rect.width = 1;
+                 test_rect.height = 1;
+
+                 tool_bar_p = gtk_widget_intersect (FRAME_X_OUTPUT (f)->toolbar_widget,
+                                                    &test_rect, NULL);
+               }
 #endif
 
-             if (!menu_bar_p)
+             if (!menu_bar_p && !tool_bar_p)
                {
                  if (f && device->direct_p)
                    {