#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)
{
device->grab &= ~(1 << xev->detail);
}
- xi_grab_or_ungrab_device (device, dpyinfo, xev->event);
-
if (f)
f->mouse_moved = false;