From e8db10a033491059ddf2b4777c9fafed14c403e8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 6 Jan 2012 13:49:04 +1000 Subject: [PATCH 1/4] Require inputproto 2.1.99.5 Signed-off-by: Peter Hutterer --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6de92b435..23a6d1554 100644 --- a/configure.ac +++ b/configure.ac @@ -776,7 +776,7 @@ XPROTO="xproto >= 7.0.22" RANDRPROTO="randrproto >= 1.2.99.3" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.1.99" -INPUTPROTO="inputproto >= 2.1.99.3" +INPUTPROTO="inputproto >= 2.1.99.5" KBPROTO="kbproto >= 1.0.3" FONTSPROTO="fontsproto" FIXESPROTO="fixesproto >= 5.0" From 075a473e538efb771497b762101694b6c0c45c2b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 3 Jan 2012 02:43:40 +0100 Subject: [PATCH 2/4] dix: Set XITouchEmulatingPointer on events from the touch sequence emulating pointer events The internal flag is kept around, merely translated to XITouchEmulatingPointer when creating the XI2 events that will be delivered to the client. Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Reviewed-by: Chase Douglas Signed-off-by: Peter Hutterer --- dix/eventconvert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 017c87190..60dc22fff 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -691,6 +691,10 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) else xde->flags = ev->flags; + if (IsTouchEvent((InternalEvent*)ev) && + ev->flags & TOUCH_POINTER_EMULATED) + xde->flags |= XITouchEmulatingPointer; + if (ev->key_repeat) xde->flags |= XIKeyRepeat; From e30c3c5c59abba9713cf3be532a46220aa9aeeca Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Wed, 4 Jan 2012 15:50:40 -0800 Subject: [PATCH 3/4] 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; From 146008358e9dd9b178bd5305bcc1680ca16c328d Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Thu, 5 Jan 2012 16:43:40 -0800 Subject: [PATCH 4/4] 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 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- Xi/exevents.c | 14 ++++++-------- 1 file 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: