summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-03-27 12:36:42 -0400
committerAdam Jackson <ajax@redhat.com>2009-03-27 12:36:42 -0400
commitbb89fc2771d2e54d7e0cd0371db68ddb754a64e5 (patch)
treec6017cb947f5427f158f36cd2446a492931914e3 /mi
parent2c000f4980d30015e6da95de3c77c0fdda0090e4 (diff)
misprite: Fix software cursor on multiple ScreenRecs
Diffstat (limited to 'mi')
-rw-r--r--mi/misprite.c17
-rw-r--r--mi/mispritest.h1
2 files changed, 7 insertions, 11 deletions
diff --git a/mi/misprite.c b/mi/misprite.c
index ff727d551..81a0b9d58 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -56,8 +56,6 @@ in this Software without prior written authorization from The Open Group.
#endif
# include "damage.h"
-
-
#define SPRITE_DEBUG_ENABLE 0
#if SPRITE_DEBUG_ENABLE
#define SPRITE_DEBUG(x) ErrorF x
@@ -65,29 +63,26 @@ in this Software without prior written authorization from The Open Group.
#define SPRITE_DEBUG(x)
#endif
-
#define MISPRITE(dev) \
((DevHasCursor(dev)) ? \
(miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \
(miCursorInfoPtr)dixLookupPrivate(&dev->u.master->devPrivates, miSpriteDevPrivatesKey))
-static int damageRegister = 0;
-
static void
miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{
- if (damageRegister) {
+ if (pScreenPriv->damageRegistered) {
DamageUnregister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
pScreenPriv->pDamage);
- damageRegister = 0;
+ pScreenPriv->damageRegistered = 0;
}
}
static void
miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{
- if (!damageRegister) {
- damageRegister = 1;
+ if (!pScreenPriv->damageRegistered) {
+ pScreenPriv->damageRegistered = 1;
DamageRegister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
pScreenPriv->pDamage);
}
@@ -269,6 +264,8 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreenPriv->colors[MASK_COLOR].red = 0;
pScreenPriv->colors[MASK_COLOR].green = 0;
pScreenPriv->colors[MASK_COLOR].blue = 0;
+ pScreenPriv->damageRegistered = 0;
+
dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv);
pScreen->CloseScreen = miSpriteCloseScreen;
@@ -282,8 +279,6 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreen->BlockHandler = miSpriteBlockHandler;
- damageRegister = 0;
-
return TRUE;
}
diff --git a/mi/mispritest.h b/mi/mispritest.h
index 232cdaffe..1b24f262b 100644
--- a/mi/mispritest.h
+++ b/mi/mispritest.h
@@ -87,6 +87,7 @@ typedef struct {
VisualPtr pVisual;
miSpriteCursorFuncPtr funcs;
DamagePtr pDamage; /* damage tracking structure */
+ Bool damageRegistered;
} miSpriteScreenRec, *miSpriteScreenPtr;
#define SOURCE_COLOR 0