dix: consolidate ProcGetGeometry()

No need to have it split into two functions one just wrapping
another, so move it all into one.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-04-02 19:58:18 +02:00
parent 1035323b36
commit 923de1a7a4

View File

@ -999,8 +999,8 @@ ProcCirculateWindow(ClientPtr client)
return Success; return Success;
} }
static int int
GetGeometry(ClientPtr client, xGetGeometryReply * rep) ProcGetGeometry(ClientPtr client)
{ {
DrawablePtr pDraw; DrawablePtr pDraw;
int rc; int rc;
@ -1012,37 +1012,23 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep)
if (rc != Success) if (rc != Success)
return rc; return rc;
rep->type = X_Reply; xGetGeometryReply rep = {
rep->length = 0; .type = X_Reply,
rep->sequenceNumber = client->sequence; .length = 0,
rep->root = pDraw->pScreen->root->drawable.id; .sequenceNumber = client->sequence,
rep->depth = pDraw->depth; .root = pDraw->pScreen->root->drawable.id,
rep->width = pDraw->width; .depth = pDraw->depth,
rep->height = pDraw->height; .width = pDraw->width,
.height = pDraw->height,
};
if (WindowDrawable(pDraw->type)) { if (WindowDrawable(pDraw->type)) {
WindowPtr pWin = (WindowPtr) pDraw; WindowPtr pWin = (WindowPtr) pDraw;
rep->x = pWin->origin.x - wBorderWidth(pWin); rep.x = pWin->origin.x - wBorderWidth(pWin);
rep->y = pWin->origin.y - wBorderWidth(pWin); rep.y = pWin->origin.y - wBorderWidth(pWin);
rep->borderWidth = pWin->borderWidth; rep.borderWidth = pWin->borderWidth;
} }
else { /* DRAWABLE_PIXMAP */
rep->x = rep->y = rep->borderWidth = 0;
}
return Success;
}
int
ProcGetGeometry(ClientPtr client)
{
xGetGeometryReply rep = { .type = X_Reply };
int status;
if ((status = GetGeometry(client, &rep)) != Success)
return status;
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
return Success; return Success;