summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPovilas Kanapickas <povilas@radix.lt>2020-12-20 00:48:21 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2021-02-15 04:40:16 +0000
commit30e11535afb3c4efc3a5cef640de44c7cd9bb561 (patch)
treecdb606283698d2c8ca7f69a2b5df138c0b47e194
parentf682e0563f736ed2c2c612ed575e05b6e3db945e (diff)
Revert "Xi: Use current device active grab to deliver touch events if any"
-rw-r--r--Xi/exevents.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 193e57e22..29c617c14 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1292,21 +1292,13 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
int rc;
InputClients *iclients = NULL;
*mask = NULL;
- *grab = NULL;
if (listener->type == TOUCH_LISTENER_GRAB ||
listener->type == TOUCH_LISTENER_POINTER_GRAB) {
*grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE);
- }
- else if (ti->emulate_pointer && dev->deviceGrab.grab &&
- !dev->deviceGrab.fromPassiveGrab) {
- /* There may be an active pointer grab on the device */
- *grab = dev->deviceGrab.grab;
- }
- if (*grab) {
*client = rClient(*grab);
*win = (*grab)->window;
*mask = (*grab)->xi2mask;
@@ -1363,6 +1355,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* if owner selected, oclients is NULL */
*client = oclients ? rClient(oclients) : wClient(*win);
}
+
+ *grab = NULL;
}
return TRUE;
@@ -1508,6 +1502,16 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
&mask))
return;
+ /* There may be a pointer grab on the device */
+ if (!grab) {
+ grab = dev->deviceGrab.grab;
+ if (grab) {
+ win = grab->window;
+ mask = grab->xi2mask;
+ client = rClient(grab);
+ }
+ }
+
DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
win, grab, mask);
}