[PATCH 21/37] dix: Drive tree mark/validate on unmap from paintable not viewable

Adam Jackson ajax at redhat.com
Wed Oct 8 08:04:45 PDT 2014


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 dix/window.c | 57 ++++++++++++++++++++++++++-------------------------------
 1 file changed, 26 insertions(+), 31 deletions(-)

diff --git a/dix/window.c b/dix/window.c
index d358960..f3b6d2e 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2734,7 +2734,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
 {
     WindowPtr pParent;
     Bool wasRealized = (Bool) pWin->realized;
-    Bool wasViewable = (Bool) pWin->viewable;
+    Bool wasPaintable = pWin->paintable;
     ScreenPtr pScreen = pWin->drawable.pScreen;
     WindowPtr pLayerWin = pWin;
 
@@ -2742,7 +2742,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
         return Success;
     if (SubStrSend(pWin, pParent))
         DeliverUnmapNotify(pWin, fromConfigure);
-    if (wasViewable && !fromConfigure) {
+    if (wasPaintable && !fromConfigure) {
         pWin->valdata = UnmapValData;
         (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin);
         (*pScreen->MarkWindow) (pLayerWin->parent);
@@ -2750,13 +2750,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
     pWin->mapped = FALSE;
     if (wasRealized)
         UnrealizeTree(pWin, fromConfigure);
-    if (wasViewable) {
-        if (!fromConfigure) {
-            (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap);
-            (*pScreen->HandleExposures) (pLayerWin->parent);
-            if (pScreen->PostValidateTree)
-                (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap);
-        }
+    if (wasPaintable && !fromConfigure) {
+        (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap);
+        (*pScreen->HandleExposures) (pLayerWin->parent);
+        if (pScreen->PostValidateTree)
+            (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap);
     }
     if (wasRealized && !fromConfigure) {
         WindowsRestructured();
@@ -2776,7 +2774,7 @@ UnmapSubwindows(WindowPtr pWin)
 {
     WindowPtr pChild, pHead;
     Bool wasRealized = (Bool) pWin->realized;
-    Bool wasViewable = (Bool) pWin->viewable;
+    Bool wasPaintable = pWin->paintable;
     Bool anyMarked = FALSE;
     Mask parentNotify;
     WindowPtr pLayerWin = NULL;
@@ -2787,7 +2785,7 @@ UnmapSubwindows(WindowPtr pWin)
     parentNotify = SubSend(pWin);
     pHead = RealChildHead(pWin);
 
-    if (wasViewable)
+    if (wasPaintable)
         pLayerWin = (*pScreen->GetLayerWindow) (pWin);
 
     for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) {
@@ -2803,31 +2801,28 @@ UnmapSubwindows(WindowPtr pWin)
                 UnrealizeTree(pChild, FALSE);
         }
     }
-    if (wasViewable) {
-        if (anyMarked) {
-            if (pLayerWin->parent == pWin)
-                (*pScreen->MarkWindow) (pWin);
-            else {
-                WindowPtr ptmp;
+    if (wasPaintable && anyMarked) {
+        if (pLayerWin->parent == pWin)
+            (*pScreen->MarkWindow) (pWin);
+        else {
+            WindowPtr ptmp;
 
-                (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL);
-                (*pScreen->MarkWindow) (pLayerWin->parent);
+            (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL);
+            (*pScreen->MarkWindow) (pLayerWin->parent);
 
-                /* Windows between pWin and pLayerWin may not have been marked */
-                ptmp = pWin;
+            /* Windows between pWin and pLayerWin may not have been marked */
+            ptmp = pWin;
 
-                while (ptmp != pLayerWin->parent) {
-                    (*pScreen->MarkWindow) (ptmp);
-                    ptmp = ptmp->parent;
-                }
-                pHead = pWin->firstChild;
+            while (ptmp != pLayerWin->parent) {
+                (*pScreen->MarkWindow) (ptmp);
+                ptmp = ptmp->parent;
             }
-            (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap);
-            (*pScreen->HandleExposures) (pLayerWin->parent);
-            if (pScreen->PostValidateTree)
-                (*pScreen->PostValidateTree) (pLayerWin->parent, pHead,
-                                              VTUnmap);
+            pHead = pWin->firstChild;
         }
+        (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap);
+        (*pScreen->HandleExposures) (pLayerWin->parent);
+        if (pScreen->PostValidateTree)
+            (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap);
     }
     if (wasRealized) {
         WindowsRestructured();
-- 
1.9.3



More information about the xorg-devel mailing list