From: Po Lu Date: Tue, 28 Dec 2021 01:28:04 +0000 (+0800) Subject: Only rely on passive device grabs on XI2 X-Git-Tag: emacs-29.0.90~3405 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0f9ec379eb8ae4ca228b87145edf04d6c8e88516;p=emacs.git Only rely on passive device grabs on XI2 * src/xterm.c (xi_grab_or_ungrab_device): Remove function. (handle_one_xevent): Stop setting non-passive grabs. --- diff --git a/src/xterm.c b/src/xterm.c index 9a4f5d39e2e..698c1eba8b7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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;