dix: tiny cleanup in CrushTree()

Make it a little bit easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2026-01-07 13:16:26 +01:00
committed by Enrico Weigelt
parent dc55d361d8
commit 3adf207be1

View File

@@ -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;