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 */ /* All we look at is the type field */
/* This is common to all replies */ /* This is common to all replies */
if (rep->RepType == X_GetSelectedExtensionEvents) if (rep->RepType == X_GetDeviceDontPropagateList)
SRepXGetSelectedExtensionEvents(client, len,
(xGetSelectedExtensionEventsReply *)
rep);
else if (rep->RepType == X_GetDeviceDontPropagateList)
SRepXGetDeviceDontPropagateList(client, len, SRepXGetDeviceDontPropagateList(client, len,
(xGetDeviceDontPropagateListReply *) (xGetDeviceDontPropagateListReply *)
rep); rep);

View File

@ -145,7 +145,13 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
ClassFromMask(aclient, others->mask[i], i, NULL, CREATE); 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) { if (total_length) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@ -154,21 +160,3 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
free(buf); free(buf);
return Success; 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 */ int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
); );
void SRepXGetSelectedExtensionEvents(ClientPtr /* client */ ,
int /* size */ ,
xGetSelectedExtensionEventsReply * /* rep */
);
#endif /* GETSELEV_H */ #endif /* GETSELEV_H */