If a touch ends before the 5 motion events have occurred, the parent window must also accept or reject the touch. Otherwise, the touch will be left dangling.
I also added a printout stating whether the client accepted or rejected the touch. Signed-off-by: Chase Douglas <[email protected]> --- src/test_xi2.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test_xi2.c b/src/test_xi2.c index a219d14..7c1af68 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -92,11 +92,16 @@ static void print_deviceevent(XIDeviceEvent* event) if (event->evtype == XI_TouchBegin) touch_events_received = 0; - else if (event->evtype == XI_TouchMotion && event->event != event->child && - (event->flags & XITouchOwner) && ++touch_events_received == 5) + else if ((event->flags & XITouchOwner) && event->event != event->child && + ((event->evtype == XI_TouchMotion && ++touch_events_received == 5) || + (event->evtype == XI_TouchEnd && touch_events_received < 5))) + { + printf("---- Parent window is %s the touch ----\n", + (thong ? "rejecting" : "accepting")); XIAllowTouchEvents(event->display, event->sourceid, event->detail, (thong ^= 1) ? XITouchOwnerAccept : XITouchOwnerReject); + } } static void print_devicechangedevent(Display *dpy, XIDeviceChangedEvent *event) -- 1.7.2.3 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
