[PATCH] Remember drawable ID used to find damage target for use in events. Bug 5730.

Keith Packard keithp at keithp.com
Tue May 11 09:11:33 PDT 2010


Using Composite, window pixmaps are given names in the client resource
namespace and yet may not have any XID recorded in the drawable
structure. As such, we need to remember the XID used to lookup the
pixmap in the resource database so that we can report the correct XID
back to the client in damage events.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 damageext/damageext.c    |    3 ++-
 damageext/damageextint.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/damageext/damageext.c b/damageext/damageext.c
index 462796e..4e9019c 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -51,7 +51,7 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
     ev.type = DamageEventBase + XDamageNotify;
     ev.level = pDamageExt->level;
     ev.sequenceNumber = pClient->sequence;
-    ev.drawable = pDrawable->id;
+    ev.drawable = pDamageExt->drawable;
     ev.damage = pDamageExt->id;
     ev.timestamp = currentTime.milliseconds;
     ev.geometry.x = pDrawable->x;
@@ -205,6 +205,7 @@ ProcDamageCreate (ClientPtr client)
     if (!pDamageExt)
 	return BadAlloc;
     pDamageExt->id = stuff->damage;
+    pDamageExt->drawable = stuff->drawable;
     pDamageExt->pDrawable = pDrawable;
     pDamageExt->level = level;
     pDamageExt->pClient = client;
diff --git a/damageext/damageextint.h b/damageext/damageextint.h
index 45c5ff9..d40ba3e 100644
--- a/damageext/damageextint.h
+++ b/damageext/damageextint.h
@@ -55,6 +55,7 @@ typedef struct _DamageExt {
     DamageReportLevel	level;
     ClientPtr		pClient;
     XID			id;
+    XID			drawable;
 } DamageExtRec, *DamageExtPtr;
 
 #define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
-- 
1.7.1



More information about the xorg-devel mailing list