Skip to content

Commit d780c6f

Browse files
syrjalajeremyhu
authored andcommitted
composite: Update borderClip in compAllocPixmap()
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 <[email protected]> Reviewed-by: Keith Packard <[email protected]> Signed-off-by: Keith Packard <[email protected]> (cherry picked from commit a5266dc)
1 parent 12f6581 commit d780c6f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

composite/compalloc.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
196196

197197
anyMarked = compMarkWindows (pWin, &pLayerWin);
198198

199-
/* Make sure our borderClip is correct for ValidateTree */
200199
RegionNull(&cw->borderClip);
201-
RegionCopy(&cw->borderClip, &pWin->borderClip);
202-
cw->borderClipX = pWin->drawable.x;
203-
cw->borderClipY = pWin->drawable.y;
204200
cw->update = CompositeRedirectAutomatic;
205201
cw->clients = 0;
206202
cw->oldx = COMP_ORIGIN_INVALID;
@@ -658,6 +654,13 @@ compAllocPixmap (WindowPtr pWin)
658654
DamageRegister (&pWin->drawable, cw->damage);
659655
cw->damageRegistered = TRUE;
660656
}
657+
658+
/* Make sure our borderClip is up to date */
659+
RegionUninit(&cw->borderClip);
660+
RegionCopy(&cw->borderClip, &pWin->borderClip);
661+
cw->borderClipX = pWin->drawable.x;
662+
cw->borderClipY = pWin->drawable.y;
663+
661664
return TRUE;
662665
}
663666

0 commit comments

Comments
 (0)