damage: Must translate initial window damage by window offset
authorKeith Packard <keithp@keithp.com>
Fri, 20 Sep 2013 19:43:41 +0000 (14:43 -0500)
committerKeith Packard <keithp@keithp.com>
Fri, 20 Sep 2013 22:42:13 +0000 (17:42 -0500)
Damage is reported relative to the drawable origin, but the window
borderClip is absolute. Translate the region by the window position
before reporting damage to adjust.

Reported-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
damageext/damageext.c

index a942ffa..cf6b63b 100644 (file)
@@ -223,7 +223,9 @@ ProcDamageCreate(ClientPtr client)
 
     if (pDrawable->type == DRAWABLE_WINDOW) {
         pRegion = &((WindowPtr) pDrawable)->borderClip;
+        RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y);
         DamageReportDamage(pDamageExt->pDamage, pRegion);
+        RegionTranslate(pRegion, pDrawable->x, pDrawable->y);
     }
 
     return Success;