diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-22 16:55:12 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-01 08:46:31 +1000 |
commit | 1bcc0d3c244ce7d9f5cbab626aa5fd5784b41a1c (patch) | |
tree | 3c827a8e038b2bdea80c5c4e39556929a7857d69 /dix/devices.c | |
parent | 34424fab9abd7a4ca11036be25414129980db0e0 (diff) |
input: abstract Xtst device lookup
The callers should need to use the dev privates key to look up xtest
devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
Diffstat (limited to 'dix/devices.c')
-rw-r--r-- | dix/devices.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c index b237e03b1..2d776577c 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2589,3 +2589,16 @@ int AllocXtstDevice (ClientPtr client, char* name, return retval; } + +/** + * If master is NULL, return TRUE if the given device is an xtest device or + * FALSE otherwise. + * If master is not NULL, return TRUE if the given device is this master's + * xtest device. + */ +BOOL +IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master) +{ + return (!IsMaster(dev) && (!master || dev->u.master == master) && + ( dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey) != NULL)); +} |