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:
Enrico Weigelt, metux IT consult 2025-04-01 11:58:08 +02:00
parent 3695324145
commit 3ff2fd4d32
3 changed files with 5 additions and 26 deletions

View File

@ -421,9 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
{
/* All we look at is the type field */
/* This is common to all replies */
if (rep->RepType == X_SetDeviceValuators)
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
else if (rep->RepType == X_GetDeviceControl)
if (rep->RepType == X_GetDeviceControl)
SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep);
else if (rep->RepType == X_ChangeDeviceControl)
SRepXChangeDeviceControl(client, len,

View File

@ -82,7 +82,6 @@ ProcXSetDeviceValuators(ClientPtr client)
.repType = X_Reply,
.RepType = X_SetDeviceValuators,
.sequenceNumber = client->sequence,
.length = 0,
.status = Success
};
@ -112,22 +111,9 @@ ProcXSetDeviceValuators(ClientPtr client)
if (rep.status != Success && rep.status != AlreadyGrabbed)
return rep.status;
WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
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);
}

View File

@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
int ProcXSetDeviceValuators(ClientPtr /* client */
);
void SRepXSetDeviceValuators(ClientPtr /* client */ ,
int /* size */ ,
xSetDeviceValuatorsReply * /* rep */
);
#endif /* SETDVAL_H */