XI: directly write out X_QueryDeviceState reply

Write out the X_QueryDeviceState 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:56:15 +02:00
parent 13cc0cdf09
commit 3695324145
3 changed files with 8 additions and 26 deletions

View File

@@ -150,24 +150,13 @@ ProcXQueryDeviceState(ClientPtr client)
.length = bytes_to_int32(total_length),
.num_classes = num_classes
};
WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
if (total_length > 0)
WriteToClient(client, total_length, savbuf);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xQueryDeviceStateReply), &rep);
WriteToClient(client, total_length, savbuf);
free(savbuf);
return Success;
}
/***********************************************************************
*
* This procedure writes the reply for the XQueryDeviceState function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}