aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2021-11-28 13:43:19 +0800
committerPo Lu2021-11-28 13:43:19 +0800
commit3ce591804badfde86870aa02a1432e870028e531 (patch)
tree7341b101e72730b9689cb6bcca66f0d9e4f0e797 /src
parentbd321f78eb8db839147a13a8543c0d3ca878f242 (diff)
downloademacs-3ce591804badfde86870aa02a1432e870028e531.tar.gz
emacs-3ce591804badfde86870aa02a1432e870028e531.zip
Fix xwidget popups on XI2 again
* src/xwidget.c (xwidget_button_1): Release seat grab.
Diffstat (limited to 'src')
-rw-r--r--src/xwidget.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xwidget.c b/src/xwidget.c
index e07b290acbf..a5b96d01100 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -910,6 +910,8 @@ xwidget_button_1 (struct xwidget_view *view,
910#ifdef HAVE_XINPUT2 910#ifdef HAVE_XINPUT2
911 struct x_display_info *dpyinfo; 911 struct x_display_info *dpyinfo;
912 struct xi_device_t *xi_device; 912 struct xi_device_t *xi_device;
913 GdkSeat *seat;
914 GdkDevice *device;
913#endif 915#endif
914 916
915 /* X and Y should be relative to the origin of view->wdesc. */ 917 /* X and Y should be relative to the origin of view->wdesc. */
@@ -936,12 +938,20 @@ xwidget_button_1 (struct xwidget_view *view,
936 938
937#ifdef HAVE_XINPUT2 939#ifdef HAVE_XINPUT2
938 dpyinfo = FRAME_DISPLAY_INFO (view->frame); 940 dpyinfo = FRAME_DISPLAY_INFO (view->frame);
941 device = xg_event->button.device;
942
939 for (int idx = 0; idx < dpyinfo->num_devices; ++idx) 943 for (int idx = 0; idx < dpyinfo->num_devices; ++idx)
940 { 944 {
941 xi_device = &dpyinfo->devices[idx]; 945 xi_device = &dpyinfo->devices[idx];
942 946
943 XIUngrabDevice (view->dpy, xi_device->device_id, CurrentTime); 947 XIUngrabDevice (view->dpy, xi_device->device_id, CurrentTime);
944 } 948 }
949
950 if (device)
951 {
952 seat = gdk_device_get_seat (device);
953 gdk_seat_ungrab (seat);
954 }
945#endif 955#endif
946 956
947 gtk_main_do_event (xg_event); 957 gtk_main_do_event (xg_event);