xorg-x11-server/0011-Xi-if-a-passive-async-grab-is-activated-from-an-emul.patch

39 lines
1.4 KiB
Diff

From 6c9e0b84996a13aafd01cccdb63d0d3949d15851 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 28 Feb 2013 15:28:46 +1000
Subject: [PATCH 11/35] Xi: if a passive async grab is activated from an
emulated touch, accept
Async grabs cannot replay events, they cannot reject, so we can do an early
accept here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d905348134c80f19793eefb761731b00559ddf3a)
---
Xi/exevents.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Xi/exevents.c b/Xi/exevents.c
index f3fd697..21acf79 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1846,8 +1846,14 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
listener->type == LISTENER_POINTER_GRAB) {
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
grab, xi2mask);
- if (rc == Success)
+ if (rc == Success) {
listener->state = LISTENER_IS_OWNER;
+ /* async grabs cannot replay, so automatically accept this touch */
+ if (dev->deviceGrab.grab &&
+ dev->deviceGrab.fromPassiveGrab &&
+ dev->deviceGrab.grab->pointerMode == GrabModeAsync)
+ ActivateEarlyAccept(dev, ti);
+ }
goto out;
}
--
1.8.2.1