[PATCH xserver] composite: Update borderClip in compAllocPixmap()

Ville Syrjala syrjala at sci.fi
Sat Oct 8 15:11:04 PDT 2011


Previously the parent constrained borderClip was copied over
when compRedirectWindow() is called. That is insufficient eg. in
case the window was already redirected, but not yet realized. So
copy the borderClip over in compAllocPixmap() instead.

Example:
Window 1 is below an automatically redirect window 2. Window 2 is
unmapped and moved outside the extents of window 1. Window 2 is
then mapped again, and MarkOverlappedWindows() uses the up to
date borderSize of window 2 to mark windows, which leaves
window 1 unmarked. Then exposures are calculated using the stale
borderClip of window 2, which causes the window below window 2,
to be exposed through an apparent hole in window 1.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22566

Signed-off-by: Ville Syrjala <syrjala at sci.fi>
---
 composite/compalloc.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index f00bf4e..9857a92 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -196,11 +196,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
 
 	anyMarked = compMarkWindows (pWin, &pLayerWin);
 
-	/* Make sure our borderClip is correct for ValidateTree */
 	RegionNull(&cw->borderClip);
-	RegionCopy(&cw->borderClip, &pWin->borderClip);
-	cw->borderClipX = pWin->drawable.x;
-	cw->borderClipY = pWin->drawable.y;
 	cw->update = CompositeRedirectAutomatic;
 	cw->clients = 0;
 	cw->oldx = COMP_ORIGIN_INVALID;
@@ -658,6 +654,13 @@ compAllocPixmap (WindowPtr pWin)
 	DamageRegister (&pWin->drawable, cw->damage);
 	cw->damageRegistered = TRUE;
     }
+
+    /* Make sure our borderClip is up to date */
+    RegionUninit(&cw->borderClip);
+    RegionCopy(&cw->borderClip, &pWin->borderClip);
+    cw->borderClipX = pWin->drawable.x;
+    cw->borderClipY = pWin->drawable.y;
+
     return TRUE;
 }
 
-- 
1.7.3.4



More information about the xorg-devel mailing list