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 /Xi/xichangehierarchy.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 'Xi/xichangehierarchy.c')
-rw-r--r-- | Xi/xichangehierarchy.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 917a0d7d9..137c20914 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -54,8 +54,6 @@ #include "xichangehierarchy.h" -extern DevPrivateKey XTstDevicePrivateKey; - /** * Send the current state of the device hierarchy to all clients. */ @@ -260,8 +258,7 @@ ProcXIChangeHierarchy(ClientPtr client) } for(xtstdevice = inputInfo.devices; xtstdevice ; xtstdevice = xtstdevice->next ) - if( !IsMaster(xtstdevice) && xtstdevice->u.master == ptr && - dixLookupPrivate(&xtstdevice->devPrivates, XTstDevicePrivateKey )) + if (IsXtstDevice(xtstdevice, ptr)) break; rc = dixLookupDevice(&xtstptr, xtstdevice->id, client, @@ -297,10 +294,7 @@ ProcXIChangeHierarchy(ClientPtr client) { /* Search the matching keyboard */ for(xtstdevice = inputInfo.devices; xtstdevice ; xtstdevice = xtstdevice->next ) - if( !IsMaster(xtstdevice) && - xtstdevice->u.master == keybd && - IsKeyboardDevice(xtstdevice) && - dixLookupPrivate(&xtstdevice->devPrivates, XTstDevicePrivateKey )) + if(IsKeyboardDevice(xtstdevice) && IsXtstDevice(xtstdevice, keybd)) break; rc = dixLookupDevice(&xtstkeybd, @@ -316,11 +310,7 @@ ProcXIChangeHierarchy(ClientPtr client) xtstkeybd = xtstptr; /* Search the matching pointer */ for(xtstdevice = inputInfo.devices; xtstdevice ; xtstdevice = xtstdevice->next ) - if( !IsMaster(xtstdevice) && - xtstdevice->u.master == ptr && - IsPointerDevice(xtstdevice) && - dixLookupPrivate(&xtstdevice->devPrivates, XTstDevicePrivateKey ) - ) + if(IsPointerDevice(xtstdevice) && IsXtstDevice(xtstdevice, ptr)) break; rc = dixLookupDevice(&xtstptr, xtstdevice->id, @@ -412,7 +402,6 @@ ProcXIChangeHierarchy(ClientPtr client) case XIDetachSlave: { xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any; - DeviceIntPtr *xtstdevice; rc = dixLookupDevice(&ptr, c->deviceid, client, DixManageAccess); @@ -426,11 +415,8 @@ ProcXIChangeHierarchy(ClientPtr client) goto unwind; } - xtstdevice = dixLookupPrivate( &ptr->devPrivates, - XTstDevicePrivateKey ); - /* Don't allow changes to Xtst Devices, these are fixed */ - if( xtstdevice ) + if (IsXtstDevice(ptr, NULL)) { client->errorValue = c->deviceid; rc = BadDevice; @@ -445,7 +431,6 @@ ProcXIChangeHierarchy(ClientPtr client) { xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any; DeviceIntPtr newmaster; - DeviceIntPtr *xtstdevice; rc = dixLookupDevice(&ptr, c->deviceid, client, DixManageAccess); @@ -459,11 +444,8 @@ ProcXIChangeHierarchy(ClientPtr client) goto unwind; } - xtstdevice = dixLookupPrivate( &ptr->devPrivates, - XTstDevicePrivateKey ); - /* Don't allow changes to Xtst Devices, these are fixed */ - if( xtstdevice ) + if (IsXtstDevice(ptr, NULL)) { client->errorValue = c->deviceid; rc = BadDevice; |