]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix xwidget popups on XI2 again
authorPo Lu <luangruo@yahoo.com>
Sun, 28 Nov 2021 05:43:19 +0000 (13:43 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 28 Nov 2021 05:43:19 +0000 (13:43 +0800)
* src/xwidget.c (xwidget_button_1): Release seat grab.

src/xwidget.c

index e07b290acbfcff407f98d9cfbcf924fb0d3167cd..a5b96d01100e1429e4a984702bc9a3b1e0832d41 100644 (file)
@@ -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);