From: Po Lu Date: Sun, 28 Nov 2021 05:43:19 +0000 (+0800) Subject: Fix xwidget popups on XI2 again X-Git-Tag: emacs-29.0.90~3649^2~16 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ce591804badfde86870aa02a1432e870028e531;p=emacs.git Fix xwidget popups on XI2 again * src/xwidget.c (xwidget_button_1): Release seat grab. --- 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, #ifdef HAVE_XINPUT2 struct x_display_info *dpyinfo; struct xi_device_t *xi_device; + GdkSeat *seat; + GdkDevice *device; #endif /* X and Y should be relative to the origin of view->wdesc. */ @@ -936,12 +938,20 @@ xwidget_button_1 (struct xwidget_view *view, #ifdef HAVE_XINPUT2 dpyinfo = FRAME_DISPLAY_INFO (view->frame); + device = xg_event->button.device; + for (int idx = 0; idx < dpyinfo->num_devices; ++idx) { xi_device = &dpyinfo->devices[idx]; XIUngrabDevice (view->dpy, xi_device->device_id, CurrentTime); } + + if (device) + { + seat = gdk_device_get_seat (device); + gdk_seat_ungrab (seat); + } #endif gtk_main_do_event (xg_event);