From e30c3c5c59abba9713cf3be532a46220aa9aeeca Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Wed, 4 Jan 2012 15:50:40 -0800 Subject: [PATCH] Don't end touchpoint if owning client hasn't accepted/rejected A touchpoint is ended when no further processing will take place for it. This includes the situation where there is only one grabbing client, and the client receives a touch end before it has accepted/rejected the touchpoint. This change ensures that a delivered touch end event is converted into a touch update event under the above scenario. If the event is left as a touch end event, the touchpoint will be ended in ProcessTouchEvent(). Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- Xi/exevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index db49e31b8..b3b05f742 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1803,8 +1803,10 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); listener->state = LISTENER_HAS_END; } - if (ti->num_listeners > 1 && - (ev->device_event.flags & (TOUCH_ACCEPT|TOUCH_REJECT)) == 0) + if ((ti->num_listeners > 1 || + (listener->type == LISTENER_GRAB && + xi2mask_isset(xi2mask, dev, XI_TouchOwnership))) && + (ev->device_event.flags & (TOUCH_ACCEPT|TOUCH_REJECT)) == 0) { ev->any.type = ET_TouchUpdate; ev->device_event.flags |= TOUCH_PENDING_END;