XI: directly write out X_GetSelectedExtensionEvents reply

Write out X_GetSelectedExtensionEvents 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 20:07:41 +02:00
parent 00a19a11d5
commit c1d828910a
3 changed files with 8 additions and 29 deletions

View File

@ -421,11 +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_GetSelectedExtensionEvents)
SRepXGetSelectedExtensionEvents(client, len,
(xGetSelectedExtensionEventsReply *)
rep);
else if (rep->RepType == X_GetDeviceDontPropagateList)
if (rep->RepType == X_GetDeviceDontPropagateList)
SRepXGetDeviceDontPropagateList(client, len,
(xGetDeviceDontPropagateListReply *)
rep);

View File

@ -145,7 +145,13 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
ClassFromMask(aclient, others->mask[i], i, NULL, CREATE);
}
WriteReplyToClient(client, sizeof(xGetSelectedExtensionEventsReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.this_client_count);
swaps(&rep.all_clients_count);
}
WriteToClient(client, sizeof(xGetSelectedExtensionEventsReply), &rep);
if (total_length) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@ -154,21 +160,3 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
free(buf);
return Success;
}
/***********************************************************************
*
* This procedure writes the reply for the XGetSelectedExtensionEvents function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
xGetSelectedExtensionEventsReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->this_client_count);
swaps(&rep->all_clients_count);
WriteToClient(client, size, rep);
}

View File

@ -36,9 +36,4 @@ int SProcXGetSelectedExtensionEvents(ClientPtr /* client */
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
);
void SRepXGetSelectedExtensionEvents(ClientPtr /* client */ ,
int /* size */ ,
xGetSelectedExtensionEventsReply * /* rep */
);
#endif /* GETSELEV_H */