summaryrefslogtreecommitdiff
path: root/mi/misprite.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-10-17 09:52:30 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-10-17 09:52:30 +0930
commitde70cfdbe60eb6e7bf3e74dfd1ac34de554deff1 (patch)
tree4a3bf9a02cd54c7d5ec546f33a0c7dfa30b65d79 /mi/misprite.c
parent1d9ebbac8c589cae7e4952083692b6d148def9bc (diff)
mi: fix some macros to allow multiple cursors for master devices.
Macros defaulted to inputInfo.pointe rfor devices that weren't spriteOwners. Changed to take the device's master device now. This includes sticking in a number of checks and warnings that cursor rendering won't be called for floating devices.
Diffstat (limited to 'mi/misprite.c')
-rw-r--r--mi/misprite.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/mi/misprite.c b/mi/misprite.c
index 6e4215270..6aad36cfb 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -77,7 +77,7 @@ static int miSpriteDevPrivatesIndex;
#define MISPRITE(dev) \
((DevHasCursor(dev)) ? \
(miCursorInfoPtr) dev->devPrivates[miSpriteDevPrivatesIndex].ptr : \
- (miCursorInfoPtr) inputInfo.pointer->devPrivates[miSpriteDevPrivatesIndex].ptr)
+ (miCursorInfoPtr) dev->u.master->devPrivates[miSpriteDevPrivatesIndex].ptr)
/*
@@ -759,6 +759,12 @@ miSpriteRealizeCursor (pDev, pScreen, pCursor)
miCursorInfoPtr pCursorInfo;
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
+
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteRealizeCursor called for floating device.\n");
+ return FALSE;
+ }
pCursorInfo = MISPRITE(pDev);
if (pCursor == pCursorInfo->pCursor)
@@ -790,7 +796,14 @@ miSpriteSetCursor (pDev, pScreen, pCursor, x, y)
miSpriteScreenPtr pScreenPriv;
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- miCursorInfoPtr pPointer = MISPRITE(pDev);
+ miCursorInfoPtr pPointer;
+
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteSetCursor called for floating device.\n");
+ return;
+ }
+ pPointer = MISPRITE(pDev);
if (!pCursor)
{
@@ -905,6 +918,11 @@ miSpriteMoveCursor (pDev, pScreen, x, y)
CursorPtr pCursor;
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteMoveCursor called for floating device.\n");
+ return;
+ }
pCursor = MISPRITE(pDev)->pCursor;
miSpriteSetCursor (pDev, pScreen, pCursor, x, y);
@@ -972,6 +990,11 @@ miSpriteUndisplayCursor(pDev, pScreen)
DeviceIntPtr pDev;
ScreenPtr pScreen;
{
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteUndisplayCursor called for floating device.\n");
+ return;
+ }
if (MISPRITE(pDev)->isUp)
miSpriteRemoveCursor(pDev, pScreen);
}
@@ -989,6 +1012,11 @@ miSpriteRemoveCursor (pDev, pScreen)
miCursorInfoPtr pCursorInfo;
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteRemoveCursor called for floating device.\n");
+ return;
+ }
DamageDrawInternal (pScreen, TRUE);
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = MISPRITE(pDev);
@@ -1026,6 +1054,11 @@ miSpriteSaveUnderCursor(pDev, pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteSaveUnderCursor called for floating device.\n");
+ return;
+ }
DamageDrawInternal (pScreen, TRUE);
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = MISPRITE(pDev);
@@ -1065,6 +1098,12 @@ miSpriteRestoreCursor (pDev, pScreen)
int x, y;
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
+
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteRestoreCursor called for floating device.\n");
+ return;
+ }
DamageDrawInternal (pScreen, TRUE);
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
@@ -1106,6 +1145,11 @@ miSpriteComputeSaved (pDev, pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
+ if (!pDev->isMaster && !pDev->u.master)
+ {
+ ErrorF("[mi] miSpriteComputeSaved called for floating device.\n");
+ return;
+ }
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = MISPRITE(pDev);