dix: when deactivating pointer-only grabs, don't emulate TouchEnd events
A client with a pointer grab on a touch device must reject the touch when detactivating the grab while the touch is active. However, such a rejecting must not trigger a ButtonRelease event to be emulated and sent to the client. Set the grabbing listener's state to HAS_END, so we simply skip delivery to that client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
bc1f90a615
commit
ece8157a59
|
@ -1513,8 +1513,15 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
|
|||
* all the touches' listener lists. */
|
||||
for (i = 0; !wasPassive && mouse->touch && i < mouse->touch->num_touches; i++) {
|
||||
TouchPointInfoPtr ti = mouse->touch->touches + i;
|
||||
if (ti->active && TouchResourceIsOwner(ti, grab_resource))
|
||||
if (ti->active && TouchResourceIsOwner(ti, grab_resource)) {
|
||||
/* Rejecting will generate a TouchEnd, but we must not
|
||||
emulate a ButtonRelease here. So pretend the listener
|
||||
already has the end event */
|
||||
if (grab->grabtype == CORE || grab->grabtype == XI ||
|
||||
!xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))
|
||||
ti->listeners[0].state = LISTENER_HAS_END;
|
||||
TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
|
||||
}
|
||||
}
|
||||
|
||||
TouchRemovePointerGrab(mouse);
|
||||
|
|
Loading…
Reference in New Issue