[PATCH 27/37] mi: Only compute visibility events for viewable windows

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


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 mi/mivaltree.c | 62 ++++++++++++++++++++++++++++++----------------------------
 1 file changed, 32 insertions(+), 30 deletions(-)

diff --git a/mi/mivaltree.c b/mi/mivaltree.c
index 95153d6..94f88fe 100644
--- a/mi/mivaltree.c
+++ b/mi/mivaltree.c
@@ -240,40 +240,42 @@ miComputeClips(WindowPtr pParent,
     }
 #endif
 
-    oldVis = pParent->visibility;
-    switch (RegionContainsRect(universe, &borderSize)) {
-    case rgnIN:
-        newVis = VisibilityUnobscured;
-        break;
-    case rgnPART:
-        newVis = VisibilityPartiallyObscured;
-        {
-            RegionPtr pBounding;
-
-            if ((pBounding = wBoundingShape(pParent))) {
-                switch (miShapedWindowIn(universe, pBounding,
-                                         &borderSize,
-                                         pParent->drawable.x,
-                                         pParent->drawable.y)) {
-                case rgnIN:
-                    newVis = VisibilityUnobscured;
-                    break;
-                case rgnOUT:
-                    newVis = VisibilityFullyObscured;
-                    break;
+    oldVis = newVis = pParent->visibility;
+    if (pParent->viewable) {
+        switch (RegionContainsRect(universe, &borderSize)) {
+        case rgnIN:
+            newVis = VisibilityUnobscured;
+            break;
+        case rgnPART:
+            newVis = VisibilityPartiallyObscured;
+            {
+                RegionPtr pBounding;
+
+                if ((pBounding = wBoundingShape(pParent))) {
+                    switch (miShapedWindowIn(universe, pBounding,
+                                             &borderSize,
+                                             pParent->drawable.x,
+                                             pParent->drawable.y)) {
+                    case rgnIN:
+                        newVis = VisibilityUnobscured;
+                        break;
+                    case rgnOUT:
+                        newVis = VisibilityFullyObscured;
+                        break;
+                    }
                 }
             }
+            break;
+        default:
+            newVis = VisibilityFullyObscured;
+            break;
         }
-        break;
-    default:
-        newVis = VisibilityFullyObscured;
-        break;
+        pParent->visibility = newVis;
+        if (oldVis != newVis &&
+            ((pParent->
+              eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
+            SendVisibilityNotify(pParent);
     }
-    pParent->visibility = newVis;
-    if (oldVis != newVis &&
-        ((pParent->
-          eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
-        SendVisibilityNotify(pParent);
 
     dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x;
     dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y;
-- 
1.9.3



More information about the xorg-devel mailing list