dix: write out X_QueryBestSize reply directly

No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-04-04 16:12:52 +02:00
parent fa4c80243f
commit d459390a2d
4 changed files with 10 additions and 17 deletions

View File

@ -3193,7 +3193,6 @@ ProcFreeCursor(ClientPtr client)
int
ProcQueryBestSize(ClientPtr client)
{
xQueryBestSizeReply reply;
DrawablePtr pDraw;
ScreenPtr pScreen;
int rc;
@ -3219,14 +3218,21 @@ ProcQueryBestSize(ClientPtr client)
return rc;
(*pScreen->QueryBestSize) (stuff->class, &stuff->width,
&stuff->height, pScreen);
reply = (xQueryBestSizeReply) {
xQueryBestSizeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.width = stuff->width,
.height = stuff->height
};
WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.width);
swaps(&rep.height);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -310,15 +310,6 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep)
{
swaps(&pRep->sequenceNumber);
swaps(&pRep->width);
swaps(&pRep->height);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
{

View File

@ -812,7 +812,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd,
ReplyNotSwappd, /* 95 */
ReplyNotSwappd,
(ReplySwapPtr) SQueryBestSizeReply,
ReplyNotSwappd,
(ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */
(ReplySwapPtr) SListExtensionsReply,
ReplyNotSwappd, /* 100 */

View File

@ -68,10 +68,6 @@ extern void SGetFontPathReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetFontPathReply * /* pRep */ );
extern void SQueryBestSizeReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryBestSizeReply * /* pRep */ );
extern void SListExtensionsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListExtensionsReply * /* pRep */ );