composite/compalloc.c | 42 ++++++++++++++++++++++++++++++++++++++++++ composite/compint.h | 8 ++++++++ damageext/damageext.c | 21 +++++++++++++++------ 3 files changed, 65 insertions(+), 6 deletions(-) Index: damageext/damageext.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/damageext/damageext.c,v retrieving revision 1.6 diff -u -d -p -r1.6 damageext.c --- damageext/damageext.c 3 Jul 2005 07:37:35 -0000 1.6 +++ damageext/damageext.c 10 Jan 2006 23:43:00 -0000 @@ -166,6 +166,15 @@ ProcDamageQueryVersion(ClientPtr client) return(client->noClientException); } +/* + * If Composite is active, we don't want to report damage to applications + * for some trivial events (like XMoveWindow). To do that we need to give + * Composite the chance to hook in here. + */ +#ifndef COMPOSITE +#define compDamageCreate DamageCreate +#endif + static int ProcDamageCreate (ClientPtr client) { @@ -205,12 +214,12 @@ ProcDamageCreate (ClientPtr client) pDamageExt->pDrawable = pDrawable; pDamageExt->level = level; pDamageExt->pClient = client; - pDamageExt->pDamage = DamageCreate (DamageExtReport, - DamageExtDestroy, - level, - FALSE, - pDrawable->pScreen, - pDamageExt); + pDamageExt->pDamage = compDamageCreate (DamageExtReport, + DamageExtDestroy, + level, + FALSE, + pDrawable->pScreen, + pDamageExt); if (!pDamageExt->pDamage) { xfree (pDamageExt); Index: composite/compalloc.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/composite/compalloc.c,v retrieving revision 1.7 diff -u -d -p -r1.7 compalloc.c --- composite/compalloc.c 3 Jul 2005 07:37:34 -0000 1.7 +++ composite/compalloc.c 10 Jan 2006 23:43:00 -0000 @@ -110,6 +110,7 @@ compRedirectWindow (ClientPtr pClient, W cw->oldy = COMP_ORIGIN_INVALID; cw->damageRegistered = FALSE; cw->damaged = FALSE; + cw->in_move_window = FALSE; pWin->devPrivates[CompWindowPrivateIndex].ptr = cw; } ccw->next = cw->clients; @@ -551,3 +552,44 @@ compReallocPixmap (WindowPtr pWin, int d pNew->screen_y = pix_y; return TRUE; } + +static void +compWrappedDamageReport(DamagePtr pDamage, RegionPtr pRegion, void *closure) +{ + DamageExtPtr pDamageExt = closure; + DrawablePtr pDrawable = pDamageExt->pDrawable; + CompWindowPtr cw = GetCompWindow(pDrawable); + + if (cw->in_move_window && cw->update == CompositeRedirectManual) + return; + + cw->damageReport(pDamage, pRegion, closure); +} + +DamagePtr +compDamageCreate(DamageReportFunc damageReport, + DamageDestroyFunc damageDestroy, + DamageReportLevel damageLevel, + Bool isInternal, + ScreenPtr pScreen, + void *closure) +{ + DamageExtPtr pDamageExt = closure; + DamagePtr pDamage = NULL; + DrawablePtr pDrawable = pDamageExt->pDrawable; + CompWindowPtr cw = NULL; + + if (pDrawable->type == DRAWABLE_WINDOW) { + if ((cw = GetCompWindow(pDrawable)) != NULL) { + pDamage = DamageCreate(compWrappedDamageReport, damageDestroy, + damageLevel, isInternal, pScreen, closure); + if (pDamage) + cw->damageReport = damageReport; + } + } else { + pDamage = DamageCreate(damageReport, damageDestroy, damageLevel, + isInternal, pScreen, closure); + } + + return pDamage; +} Index: composite/compint.h =================================================================== RCS file: /cvs/xorg/xserver/xorg/composite/compint.h,v retrieving revision 1.8 diff -u -d -p -r1.8 compint.h --- composite/compint.h 3 Jul 2005 08:53:37 -0000 1.8 +++ composite/compint.h 10 Jan 2006 23:43:00 -0000 @@ -257,4 +257,12 @@ compCopyWindow (WindowPtr pWin, DDXPoint void compWindowUpdate (WindowPtr pWin); +DamagePtr +compDamageCreate(DamageReportFunc damageReport, + DamageDestroyFunc damageDestroy, + DamageReportLevel damageLevel, + Bool isInternal, + ScreenPtr pScreen, + void *closure); + #endif /* _COMPINT_H_ */