aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/inpututils.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-12-18 10:03:13 +0100
committermarha <marha@users.sourceforge.net>2012-12-18 10:03:13 +0100
commit293fd0043af7e861c9c540bebc44630d0da0bf9b (patch)
treea2579cb27e39607896c76419af5a1ba2f5964ec9 /xorg-server/dix/inpututils.c
parent840c8745518b92303d40f6834e9c616587242231 (diff)
downloadvcxsrv-293fd0043af7e861c9c540bebc44630d0da0bf9b.tar.gz
vcxsrv-293fd0043af7e861c9c540bebc44630d0da0bf9b.tar.bz2
vcxsrv-293fd0043af7e861c9c540bebc44630d0da0bf9b.zip
xserver mesa git update 18 oct 2012
xserver: 3420a7778c7d5eaa638327f31dd460554c257bb1 mesa: dc613f11ddf1f3a6e10c2d99830fb1a84fdb55b2
Diffstat (limited to 'xorg-server/dix/inpututils.c')
-rw-r--r--xorg-server/dix/inpututils.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c
index eb2222a07..9e38e1742 100644
--- a/xorg-server/dix/inpututils.c
+++ b/xorg-server/dix/inpututils.c
@@ -1016,6 +1016,21 @@ xi2mask_free(XI2Mask **mask)
}
/**
+ * Test if the bit for event type is set for this device only.
+ *
+ * @return TRUE if the bit is set, FALSE otherwise
+ */
+Bool
+xi2mask_isset_for_device(XI2Mask *mask, const DeviceIntPtr dev, int event_type)
+{
+ BUG_WARN(dev->id < 0);
+ BUG_WARN(dev->id >= mask->nmasks);
+ BUG_WARN(bits_to_bytes(event_type + 1) > mask->mask_size);
+
+ return BitIsOn(mask->masks[dev->id], event_type);
+}
+
+/**
* Test if the bit for event type is set for this device, or the
* XIAllDevices/XIAllMasterDevices (if applicable) is set.
*
@@ -1026,15 +1041,12 @@ xi2mask_isset(XI2Mask *mask, const DeviceIntPtr dev, int event_type)
{
int set = 0;
- BUG_WARN(dev->id < 0);
- BUG_WARN(dev->id >= mask->nmasks);
- BUG_WARN(bits_to_bytes(event_type + 1) > mask->mask_size);
-
- set = ! !BitIsOn(mask->masks[XIAllDevices], event_type);
- if (!set)
- set = ! !BitIsOn(mask->masks[dev->id], event_type);
- if (!set && IsMaster(dev))
- set = ! !BitIsOn(mask->masks[XIAllMasterDevices], event_type);
+ if (xi2mask_isset_for_device(mask, inputInfo.all_devices, event_type))
+ set = 1;
+ else if (xi2mask_isset_for_device(mask, dev, event_type))
+ set = 1;
+ else if (IsMaster(dev) && xi2mask_isset_for_device(mask, inputInfo.all_master_devices, event_type))
+ set = 1;
return set;
}