mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user