[PATCH] damage: Must translate initial window damage by window offset

Keith Packard keithp at keithp.com
Fri Sep 20 12:45:50 PDT 2013


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 at redhat.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
---
 damageext/damageext.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/damageext/damageext.c b/damageext/damageext.c
index a942ffa..cf6b63b 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -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;
-- 
1.8.4.rc3



More information about the xorg-devel mailing list