summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2012-01-05 16:43:40 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2012-01-06 14:03:11 +1000
commit146008358e9dd9b178bd5305bcc1680ca16c328d (patch)
treec588820d526a1d52acac08eb158f875962f35174
parente30c3c5c59abba9713cf3be532a46220aa9aeeca (diff)
Remove last listener on touch reject
The current code short-circuits around the block that removes the rejecting listener if it is the only listener left. It also does not delete the touchpoint record if the touch has not physically ended. This change ensures the listener is removed under these circumstances. Signed-off-by: Chase Douglas <chase.douglas@ubuntu.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--Xi/exevents.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index b3b05f742..6b2db4b59 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1159,13 +1159,11 @@ TouchEventRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
DeliverTouchEvents(sourcedev, ti, tel + i, ev->resource);
}
- /* If there are no other listeners left, then don't bother sending an
- * ownership change event to no-one; if the touchpoint is pending
+ /* If there are no other listeners left, and the touchpoint is pending
* finish, then we can just kill it now. */
- if (ti->num_listeners == 1)
+ if (ti->num_listeners == 1 && ti->pending_finish)
{
- if (ti->pending_finish)
- TouchEndTouch(sourcedev, ti);
+ TouchEndTouch(sourcedev, ti);
goto out;
}
@@ -1178,9 +1176,9 @@ TouchEventRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
ti->num_grabs--;
}
- /* If the current owner was removed, deliver the TouchOwnership or TouchBegin
- event to the new owner. */
- if (was_owner)
+ /* If the current owner was removed and there are further listeners, deliver
+ * the TouchOwnership or TouchBegin event to the new owner. */
+ if (ti->num_listeners > 0 && was_owner)
TouchPuntToNextOwner(sourcedev, ti, ev);
out: