summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-12 17:25:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-12 17:25:28 +1000
commitbb6f3514ca17d993c1af380e8d4480d61e5bbcae (patch)
tree139f90b92789840b592ab70ef49381d1f6ade4af /dix
parentf961c3a3b9dfbe1201da317c24797ba7f979731e (diff)
parent08da994a08bb74afae81176c56fb525d0439274b (diff)
Merge branch 'stack-smash-on-touchpoint' into for-keith
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c16
-rw-r--r--dix/touch.c4
2 files changed, 18 insertions, 2 deletions
diff --git a/dix/events.c b/dix/events.c
index 3282ef818..31f8d8700 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1503,11 +1503,27 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
{
GrabPtr grab = mouse->deviceGrab.grab;
DeviceIntPtr dev;
+ Bool wasPassive = mouse->deviceGrab.fromPassiveGrab;
Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab &&
mouse->deviceGrab.implicitGrab);
XID grab_resource = grab->resource;
int i;
+ /* If an explicit grab was deactivated, we must remove it from the head of
+ * 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)) {
+ /* 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);
mouse->valuator->motionHintWindow = NullWindow;
diff --git a/dix/touch.c b/dix/touch.c
index 29ba17194..d890b6227 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -915,6 +915,8 @@ TouchRemovePointerGrab(DeviceIntPtr dev)
ti = TouchFindByClientID(dev, ev->touchid);
if (!ti)
return;
+
+ /* FIXME: missing a bit of code here... */
}
/* As touch grabs don't turn into active grabs with their own resources, we
@@ -987,8 +989,6 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
for (i = 0; i < nev; i++)
mieqProcessDeviceEvent(dev, events + i, NULL);
- ProcessInputEvents();
-
FreeEventList(events, GetMaximumEventsNum());
return nev ? Success : BadMatch;