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>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user