From 923de1a7a46a1afa02d6a8f46f031073a007b84b Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 2 Apr 2025 19:58:18 +0200 Subject: [PATCH] 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 --- dix/dispatch.c | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/dix/dispatch.c b/dix/dispatch.c index 3b4349732..ff8bf989e 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -999,8 +999,8 @@ ProcCirculateWindow(ClientPtr client) return Success; } -static int -GetGeometry(ClientPtr client, xGetGeometryReply * rep) +int +ProcGetGeometry(ClientPtr client) { DrawablePtr pDraw; int rc; @@ -1012,37 +1012,23 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep) if (rc != Success) return rc; - rep->type = X_Reply; - rep->length = 0; - rep->sequenceNumber = client->sequence; - rep->root = pDraw->pScreen->root->drawable.id; - rep->depth = pDraw->depth; - rep->width = pDraw->width; - rep->height = pDraw->height; + xGetGeometryReply rep = { + .type = X_Reply, + .length = 0, + .sequenceNumber = client->sequence, + .root = pDraw->pScreen->root->drawable.id, + .depth = pDraw->depth, + .width = pDraw->width, + .height = pDraw->height, + }; if (WindowDrawable(pDraw->type)) { WindowPtr pWin = (WindowPtr) pDraw; - rep->x = pWin->origin.x - wBorderWidth(pWin); - rep->y = pWin->origin.y - wBorderWidth(pWin); - rep->borderWidth = pWin->borderWidth; + rep.x = pWin->origin.x - wBorderWidth(pWin); + rep.y = pWin->origin.y - wBorderWidth(pWin); + 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); return Success;