Commit 4c1dfd21 authored by Chase Douglas's avatar Chase Douglas Committed by Chase Douglas

Check core event mask properly for pointer emulated touch events

The current code checks the core event mask as though it were an XI2
mask. This change fixes the checks so the proper client and event masks
are used.
Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston <jeremyhu@apple.com>
Acked-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 80fefc42
......@@ -1377,6 +1377,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
BUG_WARN(!iclients);
if (!iclients)
return FALSE;
*client = rClient(iclients);
}
else if (listener->level == XI) {
int xi_type = GetXIType(TouchGetPointerEventType(ev));
......@@ -1389,20 +1391,24 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
BUG_WARN(!iclients);
if (!iclients)
return FALSE;
*client = rClient(iclients);
}
else {
int coretype = GetCoreType(TouchGetPointerEventType(ev));
Mask core_filter = event_get_filter_from_type(dev, coretype);
OtherClients *oclients;
/* all others */
nt_list_for_each_entry(iclients,
(InputClients *) wOtherClients(*win), next)
if (iclients->mask[XIAllDevices] & core_filter)
break;
/* if owner selected, iclients is NULL */
nt_list_for_each_entry(oclients,
(OtherClients *) wOtherClients(*win), next)
if (oclients->mask & core_filter)
break;
/* if owner selected, oclients is NULL */
*client = oclients ? rClient(oclients) : wClient(*win);
}
*client = iclients ? rClient(iclients) : wClient(*win);
*mask = iclients ? iclients->xi2mask : NULL;
*grab = NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment