Xi: return BadDevice for slave devices on ProcXSetClientPointer

Also clean up to return error codes instead of sending the error manually.
This commit is contained in:
Peter Hutterer 2007-11-08 10:00:35 +10:30
parent 184a7b8917
commit 180220f284

View File

@ -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;
}