XI: directly write out X_GetDeviceDontPropagateList reply

Write out X_GetDeviceDontPropagateList 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:11:14 +02:00
parent c1d828910a
commit d082992690
3 changed files with 7 additions and 28 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_GetDeviceDontPropagateList) if (rep->RepType == X_GetDeviceMotionEvents)
SRepXGetDeviceDontPropagateList(client, len,
(xGetDeviceDontPropagateListReply *)
rep);
else if (rep->RepType == X_GetDeviceMotionEvents)
SRepXGetDeviceMotionEvents(client, len, SRepXGetDeviceMotionEvents(client, len,
(xGetDeviceMotionEventsReply *) rep); (xGetDeviceMotionEventsReply *) rep);
else if (rep->RepType == X_GrabDevice) else if (rep->RepType == X_GrabDevice)

View File

@ -126,7 +126,12 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
} }
} }
WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep); if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.count);
}
WriteToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
if (count) { if (count) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@ -163,20 +168,3 @@ XEventClass
} }
return buf; return buf;
} }
/***********************************************************************
*
* This procedure writes the reply for the XGetDeviceDontPropagateList function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->count);
WriteToClient(client, size, rep);
}

View File

@ -43,9 +43,4 @@ XEventClass *ClassFromMask(XEventClass * /* buf */ ,
int /* mode */ int /* mode */
); );
void SRepXGetDeviceDontPropagateList(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceDontPropagateListReply * /* rep */
);
#endif /* GETPROP_H */ #endif /* GETPROP_H */