diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-11 09:01:12 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-20 15:17:55 +1000 |
| commit | daf7dd3bfecc9029bdd10c7a4ea5d2c875a89c41 (patch) | |
| tree | 039d04ffe3a8e04dbb75a10fdeeeeab15bcc412c | |
| parent | 8b6a370058ad5a20e0a0e49ec9443daf03775de8 (diff) | |
dix: Add GetWindowXI2Mask helper
| -rw-r--r-- | dix/events.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c index 627794197..0b704caee 100644 --- a/dix/events.c +++ b/dix/events.c @@ -423,6 +423,26 @@ GetEventFilter(DeviceIntPtr dev, xEvent *event) return 0; } +/** + * Return the windows complete XI2 mask for the given XI2 event type. + */ +Mask +GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev) +{ + OtherInputMasks *inputMasks = wOtherInputMasks(win); + int filter; + int evtype; + + if (!inputMasks || !XI2_EVENT(ev)) + return 0; + + evtype = ((xGenericEvent*)ev)->evtype; + filter = GetEventFilter(dev, ev); + + return ((inputMasks->xi2mask[dev->id][evtype/8] & filter) || + inputMasks->xi2mask[AllDevices][evtype/8] || + (inputMasks->xi2mask[AllMasterDevices][evtype/8] && dev->isMaster)); +} static CARD8 criticalEvents[32] = { |
