Xi: ProcXSetClientPointer should directly check for the client from the id.
The window ID includes the client ID anyway, so we might as well just look up the client directly instead of trying to get the window first and the client from the window. This also fixes a possible issue with XACE. If the client had permission to write on the client but not on the window, the previous approach would have failed.
This commit is contained in:
parent
521fdc28d8
commit
9cc41b88df
20
Xi/setcptr.c
20
Xi/setcptr.c
|
@ -68,7 +68,6 @@ int
|
||||||
ProcXSetClientPointer(ClientPtr client)
|
ProcXSetClientPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr pDev;
|
DeviceIntPtr pDev;
|
||||||
WindowPtr pWin;
|
|
||||||
ClientPtr targetClient;
|
ClientPtr targetClient;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -88,21 +87,12 @@ ProcXSetClientPointer(ClientPtr client)
|
||||||
|
|
||||||
if (stuff->win != None)
|
if (stuff->win != None)
|
||||||
{
|
{
|
||||||
rc = dixLookupWindow(&pWin, stuff->win, client, DixWriteAccess);
|
rc = dixLookupClient(&targetClient, stuff->win, client,
|
||||||
|
DixWriteAccess);
|
||||||
|
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
{
|
return rc;
|
||||||
/* window could not be found. maybe the window ID given was a pure
|
|
||||||
client id? */
|
|
||||||
/* XXX: Needs to be fixed for XACE */
|
|
||||||
rc = dixLookupClient(&targetClient, stuff->win,
|
|
||||||
client, DixWriteAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->win;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
targetClient= wClient(pWin);
|
|
||||||
} else
|
} else
|
||||||
targetClient = client;
|
targetClient = client;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user