XI: directly write out X_SetDeviceValuators reply
Write out the X_SetDeviceValuators 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
3695324145
commit
3ff2fd4d32
|
@ -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_SetDeviceValuators)
|
if (rep->RepType == X_GetDeviceControl)
|
||||||
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
|
|
||||||
else if (rep->RepType == X_GetDeviceControl)
|
|
||||||
SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep);
|
SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep);
|
||||||
else if (rep->RepType == X_ChangeDeviceControl)
|
else if (rep->RepType == X_ChangeDeviceControl)
|
||||||
SRepXChangeDeviceControl(client, len,
|
SRepXChangeDeviceControl(client, len,
|
||||||
|
|
22
Xi/setdval.c
22
Xi/setdval.c
|
@ -82,7 +82,6 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_SetDeviceValuators,
|
.RepType = X_SetDeviceValuators,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
|
||||||
.status = Success
|
.status = Success
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -112,22 +111,9 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
if (rep.status != Success && rep.status != AlreadyGrabbed)
|
if (rep.status != Success && rep.status != AlreadyGrabbed)
|
||||||
return rep.status;
|
return rep.status;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XSetDeviceValuators function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXSetDeviceValuators(ClientPtr client, int size,
|
|
||||||
xSetDeviceValuatorsReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int ProcXSetDeviceValuators(ClientPtr /* client */
|
int ProcXSetDeviceValuators(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXSetDeviceValuators(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xSetDeviceValuatorsReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* SETDVAL_H */
|
#endif /* SETDVAL_H */
|
||||||
|
|
Loading…
Reference in New Issue