summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2017-12-14 12:21:19 -0500
committerAdam Jackson <ajax@redhat.com>2018-01-24 16:20:21 -0500
commitd5c23b29487d5ff440abf5ed0beb22c00f21e387 (patch)
tree7ecfc916362b7075001f9602364a5f90008cc847 /composite
parentac138f9b31b0fba00742edbc3326afe66e28099a (diff)
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>
Diffstat (limited to 'composite')
-rw-r--r--composite/compalloc.c21
-rw-r--r--composite/compint.h2
-rw-r--r--composite/compwindow.c5
3 files changed, 20 insertions, 8 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c
index 05ffc7e85..433dc820a 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -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
diff --git a/composite/compint.h b/composite/compint.h
index f05c2d8a5..89f6507b9 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -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
*/
diff --git a/composite/compwindow.c b/composite/compwindow.c
index f88238146..e74ce661a 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.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);
}