diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-04-16 14:19:59 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-04-26 13:35:03 +1000 |
commit | fac2c4a5dc1d19bb347729eee8b1bbfc981b853a (patch) | |
tree | 9ff9ebb1e7b5b8853e769b1fb68987b9126fb2b9 | |
parent | aaf0063bde791659009eb9001485ac8c15745ae8 (diff) |
On touch accept, only process end event for owner if it has seen the end
We still need to generate the touch ownership event to process the
ending of the touch event in the case where the owner has the end
already.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 80d7d1ec6a9d61aa96e7d019dc1bee29d90cea34)
-rw-r--r-- | Xi/exevents.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 7ef75ec0b..e76796a09 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1273,9 +1273,18 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, if (ev->reason == XIRejectTouch) TouchRejected(dev, ti, ev->resource, ev); else if (ev->reason == XIAcceptTouch) { + int i; + + /* Go through the motions of ending the touch if the listener has + * already seen the end. This ensures that the touch record is ended in + * the server. */ + if (ti->listeners[0].state == LISTENER_HAS_END) + EmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener); + /* The touch owner has accepted the touch. Send TouchEnd events to * everyone else, and truncate the list of listeners. */ - EmitTouchEnd(dev, ti, TOUCH_ACCEPT, 0); + for (i = 1; i < ti->num_listeners; i++) + EmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[i].listener); while (ti->num_listeners > 1) TouchRemoveListener(ti, ti->listeners[1].listener); |