From d0829926906b799fd97903fd9570c7a311e9be91 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 31 Mar 2025 20:11:14 +0200 Subject: [PATCH] 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 --- Xi/extinit.c | 6 +----- Xi/getprop.c | 24 ++++++------------------ Xi/getprop.h | 5 ----- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/Xi/extinit.c b/Xi/extinit.c index abf1bdf9c..5587f0cfb 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -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_GetDeviceDontPropagateList) - SRepXGetDeviceDontPropagateList(client, len, - (xGetDeviceDontPropagateListReply *) - rep); - else if (rep->RepType == X_GetDeviceMotionEvents) + if (rep->RepType == X_GetDeviceMotionEvents) SRepXGetDeviceMotionEvents(client, len, (xGetDeviceMotionEventsReply *) rep); else if (rep->RepType == X_GrabDevice) diff --git a/Xi/getprop.c b/Xi/getprop.c index cf0ef3f04..5ef20373f 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -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) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; @@ -163,20 +168,3 @@ XEventClass } 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); -} diff --git a/Xi/getprop.h b/Xi/getprop.h index 25fa0d901..59225cba9 100644 --- a/Xi/getprop.h +++ b/Xi/getprop.h @@ -43,9 +43,4 @@ XEventClass *ClassFromMask(XEventClass * /* buf */ , int /* mode */ ); -void SRepXGetDeviceDontPropagateList(ClientPtr /* client */ , - int /* size */ , - xGetDeviceDontPropagateListReply * /* rep */ - ); - #endif /* GETPROP_H */