Revert "Xi: Use current device active grab to deliver touch events if any"

This reverts commit 98e3db2ac4.
This commit is contained in:
Povilas Kanapickas 2020-12-20 00:48:21 +02:00 committed by Peter Hutterer
parent f682e0563f
commit 30e11535af

View File

@ -1292,21 +1292,13 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
int rc; int rc;
InputClients *iclients = NULL; InputClients *iclients = NULL;
*mask = NULL; *mask = NULL;
*grab = NULL;
if (listener->type == TOUCH_LISTENER_GRAB || if (listener->type == TOUCH_LISTENER_GRAB ||
listener->type == TOUCH_LISTENER_POINTER_GRAB) { listener->type == TOUCH_LISTENER_POINTER_GRAB) {
*grab = listener->grab; *grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE); BUG_RETURN_VAL(!*grab, FALSE);
}
else if (ti->emulate_pointer && dev->deviceGrab.grab &&
!dev->deviceGrab.fromPassiveGrab) {
/* There may be an active pointer grab on the device */
*grab = dev->deviceGrab.grab;
}
if (*grab) {
*client = rClient(*grab); *client = rClient(*grab);
*win = (*grab)->window; *win = (*grab)->window;
*mask = (*grab)->xi2mask; *mask = (*grab)->xi2mask;
@ -1363,6 +1355,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* if owner selected, oclients is NULL */ /* if owner selected, oclients is NULL */
*client = oclients ? rClient(oclients) : wClient(*win); *client = oclients ? rClient(oclients) : wClient(*win);
} }
*grab = NULL;
} }
return TRUE; return TRUE;
@ -1508,6 +1502,16 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
&mask)) &mask))
return; return;
/* There may be a pointer grab on the device */
if (!grab) {
grab = dev->deviceGrab.grab;
if (grab) {
win = grab->window;
mask = grab->xi2mask;
client = rClient(grab);
}
}
DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client, DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
win, grab, mask); win, grab, mask);
} }