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:
parent
184a7b8917
commit
180220f284
20
Xi/setcptr.c
20
Xi/setcptr.c
|
@ -78,11 +78,10 @@ ProcXSetClientPointer(ClientPtr client)
|
||||||
|
|
||||||
|
|
||||||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
pDev = LookupDeviceIntRec(stuff->deviceid);
|
||||||
if (pDev == NULL || !IsPointerDevice(pDev))
|
if (pDev == NULL || !IsPointerDevice(pDev) || !pDev->isMaster)
|
||||||
{
|
{
|
||||||
SendErrorToClient(client, IReqCode, X_SetClientPointer, 0,
|
client->errorValue = stuff->deviceid;
|
||||||
BadDevice);
|
return BadDevice;
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stuff->win != None)
|
if (stuff->win != None)
|
||||||
|
@ -90,19 +89,18 @@ ProcXSetClientPointer(ClientPtr client)
|
||||||
err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
|
err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
{
|
{
|
||||||
SendErrorToClient(client, IReqCode, X_SetClientPointer,
|
client->errorValue = stuff->win;
|
||||||
stuff->win, err);
|
return err;
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
targetClient= wClient(pWin);
|
targetClient= wClient(pWin);
|
||||||
} else
|
} else
|
||||||
targetClient = client;
|
targetClient = client;
|
||||||
|
|
||||||
if (!SetClientPointer(targetClient, client, pDev))
|
if (!SetClientPointer(targetClient, client, pDev))
|
||||||
{
|
{
|
||||||
SendErrorToClient(client, IReqCode, X_SetClientPointer,
|
client->errorValue = stuff->win;
|
||||||
stuff->win, BadAccess);
|
return BadAccess;
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user