dix: write out xGetGeometryReply directly

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-04-02 20:05:59 +02:00
parent f98bc2ec60
commit d07e8dfd9a
5 changed files with 22 additions and 22 deletions

View File

@@ -556,7 +556,6 @@ PanoramiXCirculateWindow(ClientPtr client)
int
PanoramiXGetGeometry(ClientPtr client)
{
xGetGeometryReply rep;
DrawablePtr pDraw;
int rc;
@@ -567,7 +566,7 @@ PanoramiXGetGeometry(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetGeometryReply) {
xGetGeometryReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@@ -601,7 +600,16 @@ PanoramiXGetGeometry(ClientPtr client)
rep.borderWidth = pWin->borderWidth;
}
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.root);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.borderWidth);
}
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
return Success;
}

View File

@@ -1043,7 +1043,16 @@ ProcGetGeometry(ClientPtr client)
rep.borderWidth = pWin->borderWidth;
}
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.root);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.borderWidth);
}
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
return Success;
}

View File

@@ -201,19 +201,6 @@ SGetWindowAttributesReply(ClientPtr pClient, int size,
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->root);
swaps(&pRep->x);
swaps(&pRep->y);
swaps(&pRep->width);
swaps(&pRep->height);
swaps(&pRep->borderWidth);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep)
{

View File

@@ -730,7 +730,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetGeometryReply,
ReplyNotSwappd,
(ReplySwapPtr) SQueryTreeReply, /* 15 */
(ReplySwapPtr) SInternAtomReply,
(ReplySwapPtr) SGetAtomNameReply,

View File

@@ -47,10 +47,6 @@ extern void SGetWindowAttributesReply(ClientPtr /* pClient */ ,
xGetWindowAttributesReply *
/* pRep */ );
extern void SGetGeometryReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetGeometryReply * /* pRep */ );
extern void SQueryTreeReply(ClientPtr /* pClient */ ,
int /* size */ ,
xQueryTreeReply * /* pRep */ );