XI: directly write out X_ListInputDevices reply

Write out X_ListInputDevices the 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-03-31 14:29:03 +02:00
parent be45dd2d06
commit 4c27b09c53
3 changed files with 8 additions and 24 deletions

View File

@@ -384,24 +384,15 @@ ProcXListInputDevices(ClientPtr client)
}
rep.ndevices = numdevs;
rep.length = bytes_to_int32(total_length);
WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xListInputDevicesReply), &rep);
WriteToClient(client, total_length, savbuf);
free(savbuf);
free(skip);
return Success;
}
/***********************************************************************
*
* This procedure writes the reply for the XListInputDevices function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}