aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/miext/damage/damage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-24 08:40:01 +0200
committermarha <marha@users.sourceforge.net>2012-09-24 08:50:12 +0200
commitc24a0fccb18e611b2879e68565ab8f1c5c5dbd62 (patch)
tree8b2070725227ae6c92ded43789f80347fabac306 /xorg-server/miext/damage/damage.c
parent210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282 (diff)
parent0ebcd32e91486caccc041c8ca23e39e160b24702 (diff)
downloadvcxsrv-c24a0fccb18e611b2879e68565ab8f1c5c5dbd62.tar.gz
vcxsrv-c24a0fccb18e611b2879e68565ab8f1c5c5dbd62.tar.bz2
vcxsrv-c24a0fccb18e611b2879e68565ab8f1c5c5dbd62.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa pixman xserver git update 24 sep 2012 Conflicts: pixman/pixman/pixman-sse2.c xorg-server/dix/window.c
Diffstat (limited to 'xorg-server/miext/damage/damage.c')
-rw-r--r--xorg-server/miext/damage/damage.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/xorg-server/miext/damage/damage.c b/xorg-server/miext/damage/damage.c
index 445602253..70e1807cd 100644
--- a/xorg-server/miext/damage/damage.c
+++ b/xorg-server/miext/damage/damage.c
@@ -436,9 +436,13 @@ damageCreateGC(GCPtr pGC)
static void
damageValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
{
+ drawableDamage(pDrawable);
DAMAGE_GC_FUNC_PROLOGUE(pGC);
(*pGC->funcs->ValidateGC) (pGC, changes, pDrawable);
- pGCPriv->ops = pGC->ops; /* just so it's not NULL */
+ if (pDamage)
+ pGCPriv->ops = pGC->ops; /* so it's not NULL, so FUNC_EPILOGUE does work */
+ else
+ pGCPriv->ops = NULL;
DAMAGE_GC_FUNC_EPILOGUE(pGC);
}
@@ -1663,14 +1667,38 @@ miDamageCreate(DamagePtr pDamage)
{
}
+/*
+ * We only wrap into the GC when there's a registered listener. For windows,
+ * damage includes damage to children. So if there's a GC validated against
+ * a subwindow and we then register a damage on the parent, we need to bump
+ * the serial numbers of the children to re-trigger validation.
+ *
+ * Since we can't know if a GC has been validated against one of the affected
+ * children, just bump them all to be safe.
+ */
+static int
+damageRegisterVisit(WindowPtr pWin, void *data)
+{
+ pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ return WT_WALKCHILDREN;
+}
+
void
miDamageRegister(DrawablePtr pDrawable, DamagePtr pDamage)
{
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ TraverseTree((WindowPtr)pDrawable, damageRegisterVisit, NULL);
+ else
+ pDrawable->serialNumber = NEXT_SERIAL_NUMBER;
}
void
miDamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage)
{
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ TraverseTree((WindowPtr)pDrawable, damageRegisterVisit, NULL);
+ else
+ pDrawable->serialNumber = NEXT_SERIAL_NUMBER;
}
void