summaryrefslogtreecommitdiff
path: root/mi/misprite.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-02-11 12:47:37 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-22 14:35:44 +1000
commitdc57f89959e549403f8488eb9f23425bd7118b22 (patch)
tree905bf161dacd34e15051811955842ef9eaf65d10 /mi/misprite.c
parente48bf3b6403dde33586ca0e421db61e402525453 (diff)
Switch to use IsFloating()
This is not a straightforward search/replacement due to a long-standing issue. dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master device, a check for dev->u.master may give us false positives and false negatives. The switch to IsFloating() spells out these cases and modifies the conditions accordingly to cover both cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
Diffstat (limited to 'mi/misprite.c')
-rw-r--r--mi/misprite.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mi/misprite.c b/mi/misprite.c
index 770951e8f..b0290af29 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -143,7 +143,7 @@ typedef struct {
#endif
#define MISPRITE(dev) \
- ((!IsMaster(dev) && !dev->u.master) ? \
+ (IsFloating(dev) ? \
(miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \
(miCursorInfoPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miSpriteDevPrivatesKey))
@@ -766,7 +766,7 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
miCursorInfoPtr pCursorInfo;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return FALSE;
pCursorInfo = MISPRITE(pDev);
@@ -790,7 +790,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
miCursorInfoPtr pPointer;
miSpriteScreenPtr pScreenPriv;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return;
pPointer = MISPRITE(pDev);
@@ -848,7 +848,7 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
CursorPtr pCursor;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return;
pCursor = MISPRITE(pDev)->pCursor;
@@ -905,7 +905,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
miCursorInfoPtr pCursorInfo;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return;
DamageDrawInternal (pScreen, TRUE);
@@ -944,7 +944,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return;
DamageDrawInternal (pScreen, TRUE);
@@ -985,7 +985,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return;
DamageDrawInternal (pScreen, TRUE);
@@ -1025,7 +1025,7 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
- if (!IsMaster(pDev) && !pDev->u.master)
+ if (IsFloating(pDev))
return;
pCursorInfo = MISPRITE(pDev);