diff options
author | Po Lu <luangruo@yahoo.com> | 2021-12-21 14:58:44 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-12-21 15:00:08 +0800 |
commit | e70373538328dd071a73532878492ecb2fd1ee88 (patch) | |
tree | 7b5e32f784b482e7326717d90fab3dc50f8457ea /src/xterm.c | |
parent | 6d4c367f3f1f75372022afcef0ce6e200907ba3d (diff) | |
download | emacs-e70373538328dd071a73532878492ecb2fd1ee88.tar.gz emacs-e70373538328dd071a73532878492ecb2fd1ee88.tar.bz2 emacs-e70373538328dd071a73532878492ecb2fd1ee88.zip |
Ignore XI_TouchBegin events on the GTK tool bar
* src/xterm.c (handle_one_xevent): Ignore TouchBegin events
that target the tool bar.
Diffstat (limited to 'src/xterm.c')
-rw-r--r-- | src/xterm.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index 1dc68220f08..57c5616f95f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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) { |