diff options
author | Keith Packard <keithp@keithp.com> | 2012-01-09 13:17:37 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-01-09 13:17:37 -0800 |
commit | e476af417d83730b11054f4e5b127ab5540bb332 (patch) | |
tree | d1b4d1ecd882590163bc164ba2a7c568fea2763e /Xi | |
parent | f4956faab9ccf9aba6cf9603f4489f5dad19a347 (diff) | |
parent | 146008358e9dd9b178bd5305bcc1680ca16c328d (diff) |
Merge remote-tracking branch 'whot/multitouch'
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index db49e31b8..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: @@ -1803,8 +1801,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; |