From 3adf207be1f388acc57daff9f2e865596cb8ff88 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 7 Jan 2026 13:16:26 +0100 Subject: [PATCH] dix: tiny cleanup in CrushTree() Make it a little bit easier to understand. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/window.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dix/window.c b/dix/window.c index ffbc9a292c..8a2893f914 100644 --- a/dix/window.c +++ b/dix/window.c @@ -998,19 +998,20 @@ FreeWindowResources(WindowPtr pWin) static void CrushTree(WindowPtr pWin) { - WindowPtr pChild, pSib, pParent; + WindowPtr pChild, pSib; UnrealizeWindowProcPtr UnrealizeWindow; if (!(pChild = pWin->firstChild)) return; UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow; while (1) { - if (pChild->firstChild) { + + /* go to a leaf node in the window tree */ + while (pChild->firstChild) pChild = pChild->firstChild; - continue; - } + while (1) { - pParent = pChild->parent; + WindowPtr pParent = pChild->parent; if (SubStrSend(pChild, pParent)) { xEvent event = { .u.u.type = DestroyNotify }; event.u.destroyNotify.window = pChild->drawable.id;