XI: directly write out X_XIGetClientPointer reply
Write out the X_XIGetClientPointer reply directly (and do the swapping within the request handler) instead of going through separate callback that's having demux the replies again. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
f95fa10d6d
commit
e916ae88bc
|
@ -421,9 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
{
|
{
|
||||||
/* All we look at is the type field */
|
/* All we look at is the type field */
|
||||||
/* This is common to all replies */
|
/* This is common to all replies */
|
||||||
if (rep->RepType == X_XIGetClientPointer)
|
if (rep->RepType == X_XIQueryVersion)
|
||||||
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply *) rep);
|
|
||||||
else if (rep->RepType == X_XIQueryVersion)
|
|
||||||
SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep);
|
SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep);
|
||||||
else if (rep->RepType == X_XIQueryDevice)
|
else if (rep->RepType == X_XIQueryDevice)
|
||||||
SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep);
|
SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep);
|
||||||
|
|
|
@ -83,23 +83,11 @@ ProcXIGetClientPointer(ClientPtr client)
|
||||||
.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0
|
.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.deviceid);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xXIGetClientPointerReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XGetClientPointer function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXIGetClientPointer(ClientPtr client, int size,
|
|
||||||
xXIGetClientPointerReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
swaps(&rep->deviceid);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -29,10 +29,8 @@
|
||||||
|
|
||||||
#ifndef GETCPTR_H
|
#ifndef GETCPTR_H
|
||||||
#define GETCPTR_H 1
|
#define GETCPTR_H 1
|
||||||
|
|
||||||
int SProcXIGetClientPointer(ClientPtr /* client */ );
|
int SProcXIGetClientPointer(ClientPtr /* client */ );
|
||||||
int ProcXIGetClientPointer(ClientPtr /* client */ );
|
int ProcXIGetClientPointer(ClientPtr /* client */ );
|
||||||
void SRepXIGetClientPointer(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xXIGetClientPointerReply * /* rep */ );
|
|
||||||
|
|
||||||
#endif /* GETCPTR_H */
|
#endif /* GETCPTR_H */
|
||||||
|
|
Loading…
Reference in New Issue