summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-11-26 15:14:19 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-12 17:24:56 +1000
commitece8157a59751b3ed492fb2e1eb8d5f20221e195 (patch)
treeb80aba8807ea3a399a1354784573315c34ad9107
parentbc1f90a615018c05994fae3e678dd2341256cd82 (diff)
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>
-rw-r--r--dix/events.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dix/events.c b/dix/events.c
index 03ed106ed..31f8d8700 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -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);