diff --git a/Xi/exevents.c b/Xi/exevents.c index 5dc902054..dff0a92b0 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1413,7 +1413,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, !(ev->device_event.flags & TOUCH_CLIENT_ID)) TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch); - if (deliveries && ev->any.type == ET_TouchEnd && + if (ev->any.type == ET_TouchEnd && + ti->num_listeners == 1 && !dev->button->buttonsDown && dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) { (*dev->deviceGrab.DeactivateGrab) (dev); @@ -1845,7 +1846,8 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, if (rc == Success) { listener->state = LISTENER_IS_OWNER; /* async grabs cannot replay, so automatically accept this touch */ - if (dev->deviceGrab.grab && + if (listener->type == LISTENER_POINTER_GRAB && + dev->deviceGrab.grab && dev->deviceGrab.fromPassiveGrab && dev->deviceGrab.grab->pointerMode == GrabModeAsync) ActivateEarlyAccept(dev, ti); diff --git a/dix/events.c b/dix/events.c index 4632bb7db..4aaa54c85 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4696,7 +4696,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, filter = GetEventFilter(mouse, (xEvent *) event); - if (grab && grab->type == XI2) { + if (grab && grab->grabtype == XI2) { Mask mask; mask = xi2mask_isset(grab->xi2mask, mouse, type);