mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-28 08:40:07 +01:00
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: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
80fefc42f5
commit
4c1dfd2193
1 changed files with 12 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue