Allow value None for windows when setting ClientPointer.

We need this for clients that need to set the ClientPointer but don't have a
window on display yet. If used, it will set the device as the ClientPointer
for the requesting client.
This commit is contained in:
Paulo Ricardo Zanoni 2007-05-30 16:15:15 +09:30 committed by Peter Hutterer
parent d0e8f47409
commit b5db863945

View File

@ -70,6 +70,7 @@ ProcXSetClientPointer(ClientPtr client)
{ {
DeviceIntPtr pDev; DeviceIntPtr pDev;
WindowPtr pWin; WindowPtr pWin;
ClientPtr targetClient;
int err; int err;
REQUEST(xSetClientPointerReq); REQUEST(xSetClientPointerReq);
@ -93,9 +94,11 @@ ProcXSetClientPointer(ClientPtr client)
stuff->win, err); stuff->win, err);
return Success; return Success;
} }
} targetClient= wClient(pWin);
} else
targetClient = client;
if (!SetClientPointer(wClient(pWin), client, pDev)) if (!SetClientPointer(targetClient, client, pDev))
{ {
SendErrorToClient(client, IReqCode, X_SetClientPointer, SendErrorToClient(client, IReqCode, X_SetClientPointer,
stuff->win, BadAccess); stuff->win, BadAccess);