]> git.eshelyaron.com Git - emacs.git/commitdiff
Only rely on passive device grabs on XI2
authorPo Lu <luangruo@yahoo.com>
Tue, 28 Dec 2021 01:28:04 +0000 (09:28 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 28 Dec 2021 01:28:04 +0000 (09:28 +0800)
* src/xterm.c (xi_grab_or_ungrab_device): Remove function.
(handle_one_xevent): Stop setting non-passive grabs.

src/xterm.c

index 9a4f5d39e2e0b168a716e24eceff596c017e1a12..698c1eba8b781bb49a1d811648463917e801d5f8 100644 (file)
@@ -619,40 +619,6 @@ xi_find_touch_point (struct xi_device_t *device, int detail)
 
 #endif /* XI_TouchBegin */
 
-static void
-xi_grab_or_ungrab_device (struct xi_device_t *device,
-                         struct x_display_info *dpyinfo,
-                         Window window)
-{
-  XIEventMask mask;
-  ptrdiff_t l = XIMaskLen (XI_LASTEVENT);
-  unsigned char *m;
-  mask.mask = m = alloca (l);
-  memset (m, 0, l);
-  mask.mask_len = l;
-
-  XISetMask (m, XI_ButtonPress);
-  XISetMask (m, XI_ButtonRelease);
-  XISetMask (m, XI_Motion);
-  XISetMask (m, XI_Enter);
-  XISetMask (m, XI_Leave);
-
-  if (device->grab
-#if defined USE_MOTIF || defined USE_LUCID
-      && !popup_activated ()
-#endif
-      )
-    {
-      XIGrabDevice (dpyinfo->display, device->device_id, window,
-                   CurrentTime, None, GrabModeAsync,
-                   GrabModeAsync, True, &mask);
-    }
-  else
-    {
-      XIUngrabDevice (dpyinfo->display, device->device_id, CurrentTime);
-    }
-}
-
 static void
 xi_reset_scroll_valuators_for_device_id (struct x_display_info *dpyinfo, int id)
 {
@@ -10500,8 +10466,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                  device->grab &= ~(1 << xev->detail);
                }
 
-             xi_grab_or_ungrab_device (device, dpyinfo, xev->event);
-
              if (f)
                f->mouse_moved = false;