dix: write out X_GetGeometry 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:
parent
923de1a7a4
commit
b06fc7e68c
|
@ -557,7 +557,6 @@ PanoramiXCirculateWindow(ClientPtr client)
|
|||
int
|
||||
PanoramiXGetGeometry(ClientPtr client)
|
||||
{
|
||||
xGetGeometryReply rep;
|
||||
DrawablePtr pDraw;
|
||||
int rc;
|
||||
|
||||
|
@ -568,7 +567,7 @@ PanoramiXGetGeometry(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
rep = (xGetGeometryReply) {
|
||||
xGetGeometryReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0,
|
||||
|
@ -602,7 +601,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1030,7 +1030,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -729,7 +729,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetGeometryReply,
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SQueryTreeReply, /* 15 */
|
||||
(ReplySwapPtr) SInternAtomReply,
|
||||
(ReplySwapPtr) SGetAtomNameReply,
|
||||
|
|
|
@ -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 */ );
|
||||
|
|
Loading…
Reference in New Issue