diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-08 10:00:35 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-08 10:00:35 +1030 |
commit | 180220f284823c486e7001ef00f1279dc548c9c7 (patch) | |
tree | 063a43fc60af2afd7e50a000784347531af03b90 /Xi/setcptr.c | |
parent | 184a7b8917a15bb2c719153b9b016c03aab42101 (diff) |
Xi: return BadDevice for slave devices on ProcXSetClientPointer
Also clean up to return error codes instead of sending the error manually.
Diffstat (limited to 'Xi/setcptr.c')
-rw-r--r-- | Xi/setcptr.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Xi/setcptr.c b/Xi/setcptr.c index 66c8981b7..ad8f571db 100644 --- a/Xi/setcptr.c +++ b/Xi/setcptr.c @@ -78,11 +78,10 @@ ProcXSetClientPointer(ClientPtr client) pDev = LookupDeviceIntRec(stuff->deviceid); - if (pDev == NULL || !IsPointerDevice(pDev)) + if (pDev == NULL || !IsPointerDevice(pDev) || !pDev->isMaster) { - SendErrorToClient(client, IReqCode, X_SetClientPointer, 0, - BadDevice); - return Success; + client->errorValue = stuff->deviceid; + return BadDevice; } if (stuff->win != None) @@ -90,19 +89,18 @@ ProcXSetClientPointer(ClientPtr client) err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess); if (err != Success) { - SendErrorToClient(client, IReqCode, X_SetClientPointer, - stuff->win, err); - return Success; + client->errorValue = stuff->win; + return err; } targetClient= wClient(pWin); } else targetClient = client; - + if (!SetClientPointer(targetClient, client, pDev)) { - SendErrorToClient(client, IReqCode, X_SetClientPointer, - stuff->win, BadAccess); - return Success; + client->errorValue = stuff->win; + return BadAccess; } + return Success; } |