dix: write out X_TranslateCoords 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-02 20:15:21 +02:00
parent b06fc7e68c
commit df63401d6d
5 changed files with 19 additions and 22 deletions

View File

@@ -622,7 +622,6 @@ PanoramiXTranslateCoords(ClientPtr client)
REQUEST(xTranslateCoordsReq);
int rc;
WindowPtr pWin, pDst;
xTranslateCoordsReply rep;
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
@@ -631,7 +630,8 @@ PanoramiXTranslateCoords(ClientPtr client)
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
if (rc != Success)
return rc;
rep = (xTranslateCoordsReply) {
xTranslateCoordsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@@ -682,7 +682,13 @@ PanoramiXTranslateCoords(ClientPtr client)
rep.dstY += screenInfo.screens[0]->y;
}
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.child);
swaps(&rep.dstX);
swaps(&rep.dstY);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}