diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-09 13:27:19 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-11 07:38:57 +1000 |
commit | 8eeaa74bc241acb41f1d3ed64971e0b01e794776 (patch) | |
tree | c4119679b8b7e245b4f67c69557e73cf6e40d2c0 /dix/events.c | |
parent | a2d6932ad48f2cbfcc4c5fb8272e47106d08ac78 (diff) |
dix: when ungrabbing an active grab, accept pointer grabs (#66720)
Ungrabbing a device during an active touch grab rejects the grab. Ungrabbing
a device during an active pointer grab accepts the grab.
Rejection is not really an option for a pointer-emulated grab, if a client
has a button mask on the window it would get a ButtonPress emulated after
UngrabDevice. That is against the core grab behaviour.
X.Org Bug 66720 <http://bugs.freedesktop.org/show_bug.cgi?id=66720>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'dix/events.c')
-rw-r--r-- | dix/events.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/dix/events.c b/dix/events.c index e5db348c6..03b2d2ea7 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1522,13 +1522,20 @@ DeactivatePointerGrab(DeviceIntPtr mouse) for (i = 0; !wasPassive && mouse->touch && i < mouse->touch->num_touches; i++) { TouchPointInfoPtr ti = mouse->touch->touches + i; if (ti->active && TouchResourceIsOwner(ti, grab_resource)) { + int mode = XIRejectTouch; /* Rejecting will generate a TouchEnd, but we must not emulate a ButtonRelease here. So pretend the listener already has the end event */ if (grab->grabtype == CORE || grab->grabtype == XI || - !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin)) + !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin)) { + mode = XIAcceptTouch; + /* NOTE: we set the state here, but + * ProcessTouchOwnershipEvent() will still call + * TouchEmitTouchEnd for this listener. The other half of + * this hack is in DeliverTouchEndEvent */ ti->listeners[0].state = LISTENER_HAS_END; - TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch); + } + TouchListenerAcceptReject(mouse, ti, 0, mode); } } |