mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-16 09:40:31 +01:00
composite: Propagate damagedDescendants when reparented
If a window that is fully covered by an automatic-redirected descendant
(even implicitly, eg. via BackingStores) is reparented, the automatic
updates could be broken if the new parent is not marked as having
damaged descendants.
Fix this issue by propagating the damagedDescendants flag whenever a
window is reparented.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
(cherry picked from commit d5c23b2948)
This commit is contained in:
parent
df319f889d
commit
5c456b6e2a
3 changed files with 20 additions and 8 deletions
|
|
@ -67,6 +67,18 @@ compBlockHandler(ScreenPtr pScreen, void *pTimeout)
|
|||
cs->BlockHandler = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
compMarkAncestors(WindowPtr pWin)
|
||||
{
|
||||
pWin = pWin->parent;
|
||||
while (pWin) {
|
||||
if (pWin->damagedDescendants)
|
||||
return;
|
||||
pWin->damagedDescendants = TRUE;
|
||||
pWin = pWin->parent;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
||||
{
|
||||
|
|
@ -81,14 +93,7 @@ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
|||
}
|
||||
cw->damaged = TRUE;
|
||||
|
||||
/* Mark the ancestors */
|
||||
pWin = pWin->parent;
|
||||
while (pWin) {
|
||||
if (pWin->damagedDescendants)
|
||||
break;
|
||||
pWin->damagedDescendants = TRUE;
|
||||
pWin = pWin->parent;
|
||||
}
|
||||
compMarkAncestors(pWin);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -236,6 +236,8 @@ Bool
|
|||
compReallocPixmap(WindowPtr pWin, int x, int y,
|
||||
unsigned int w, unsigned int h, int bw);
|
||||
|
||||
void compMarkAncestors(WindowPtr pWin);
|
||||
|
||||
/*
|
||||
* compinit.c
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -432,6 +432,7 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
|
|||
{
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||
CompWindowPtr cw = GetCompWindow(pWin);
|
||||
|
||||
pScreen->ReparentWindow = cs->ReparentWindow;
|
||||
/*
|
||||
|
|
@ -469,6 +470,10 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
|
|||
(*pScreen->ReparentWindow) (pWin, pPriorParent);
|
||||
cs->ReparentWindow = pScreen->ReparentWindow;
|
||||
pScreen->ReparentWindow = compReparentWindow;
|
||||
|
||||
if (pWin->damagedDescendants || (cw && cw->damaged))
|
||||
compMarkAncestors(pWin);
|
||||
|
||||
compCheckTree(pWin->drawable.pScreen);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue