From 7865c254f3c7022cd4a36528379a9aa72429ebdf Mon Sep 17 00:00:00 2001 From: David Reveman Date: Wed, 3 Sep 2008 13:42:42 +0200 Subject: [PATCH] Restore window properties in the order they were created. --- hw/dmx/dmxextension.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index 8af3e0d63..0b11667ca 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -922,17 +922,28 @@ static void dmxBECreateWindowProperties (int idx) WindowPtr pRoot0 = WindowTable[0]; WindowPtr pWin; WindowPtr pWin0; - PropertyPtr pProp; + PropertyPtr pProp, pLast; - for (pProp = wUserProps (pRoot0); pProp; pProp = pProp->next) - dmxBESetWindowProperty (pRoot, pProp); - - pWin = pRoot->lastChild; - pWin0 = pRoot0->lastChild; + pWin = pRoot; + pWin0 = pRoot0; while (pWin) { - for (pProp = wUserProps (pWin0); pProp; pProp = pProp->next) - dmxBESetWindowProperty (pWin, pProp); + pLast = NULL; + for (;;) + { + for (pProp = wUserProps (pWin0); pProp; pProp = pProp->next) + { + if (pProp == pLast) + break; + + pLast = pProp; + } + + if (!pLast) + break; + + dmxBESetWindowProperty (pWin, pLast); + } /* Next, create the bottom-most child */ if (pWin->lastChild) {