Xi: if a TouchEnd appears on a actively grabbing client, always accept
Once the TouchEnd appears on the device, the touch is done. If the client still has a pointer grab, accept it to avoid clients with TouchOwnership selections to wait indefinitely for the actual touch event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ece8157a59
commit
00def51445
|
@ -1566,32 +1566,41 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
|
||||||
else
|
else
|
||||||
ti = TouchFindByClientID(dev, touchid);
|
ti = TouchFindByClientID(dev, touchid);
|
||||||
|
|
||||||
/* Under the following circumstances we create a new touch record for an
|
/* Active pointer grab */
|
||||||
* existing touch:
|
if (emulate_pointer && dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
|
||||||
*
|
|
||||||
* - The touch may be pointer emulated
|
|
||||||
* - An explicit grab is active on the device
|
|
||||||
* - The grab is a pointer grab
|
|
||||||
*
|
|
||||||
* This allows for an explicit grab to receive pointer events for an already
|
|
||||||
* active touch.
|
|
||||||
*/
|
|
||||||
if (!ti && type != ET_TouchBegin && emulate_pointer &&
|
|
||||||
dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
|
|
||||||
(dev->deviceGrab.grab->grabtype == CORE ||
|
(dev->deviceGrab.grab->grabtype == CORE ||
|
||||||
dev->deviceGrab.grab->grabtype == XI ||
|
dev->deviceGrab.grab->grabtype == XI ||
|
||||||
!xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))) {
|
!xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin)))
|
||||||
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
|
{
|
||||||
emulate_pointer);
|
/* Active pointer grab on touch point and we get a TouchEnd - claim this
|
||||||
if (!ti) {
|
* touchpoint accepted, otherwise clients waiting for ownership will
|
||||||
DebugF("[Xi] %s: Failed to create new dix record for explicitly "
|
* wait on this touchpoint until this client ungrabs, or the cows come
|
||||||
"grabbed touchpoint %d\n",
|
* home, whichever is earlier */
|
||||||
dev->name, touchid);
|
if (ti && type == ET_TouchEnd)
|
||||||
return;
|
TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
|
||||||
}
|
else if (!ti && type != ET_TouchBegin) {
|
||||||
|
/* Under the following circumstances we create a new touch record for an
|
||||||
|
* existing touch:
|
||||||
|
*
|
||||||
|
* - The touch may be pointer emulated
|
||||||
|
* - An explicit grab is active on the device
|
||||||
|
* - The grab is a pointer grab
|
||||||
|
*
|
||||||
|
* This allows for an explicit grab to receive pointer events for an already
|
||||||
|
* active touch.
|
||||||
|
*/
|
||||||
|
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
|
||||||
|
emulate_pointer);
|
||||||
|
if (!ti) {
|
||||||
|
DebugF("[Xi] %s: Failed to create new dix record for explicitly "
|
||||||
|
"grabbed touchpoint %d\n",
|
||||||
|
dev->name, touchid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TouchBuildSprite(dev, ti, ev);
|
TouchBuildSprite(dev, ti, ev);
|
||||||
TouchSetupListeners(dev, ti, ev);
|
TouchSetupListeners(dev, ti, ev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ti) {
|
if (!ti) {
|
||||||
|
|
Loading…
Reference in New Issue