diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-04-04 12:57:40 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-04-26 13:34:54 +1000 |
commit | d21d69c2d6b1eb292e9d3f6682339e93603913c9 (patch) | |
tree | 6e59fc2df88b140b29d43574d1accf4b77082db3 | |
parent | 3d3ed6023077c0324fcbf446f387edb1db677b84 (diff) |
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>
(cherry picked from commit 4c1dfd21937efc6a85fb204a73dd7d7151d54daa)
-rw-r--r-- | Xi/exevents.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index b2dfc1383..abd68fc02 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -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; } |