diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-22 23:24:29 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-22 23:24:29 +0930 |
commit | e0fbe404a436aef24624a3a15e8405a9ca38aadb (patch) | |
tree | 9684b48c3507d40b65383e08bb06e52f5747e11c | |
parent | 0f15875a271889ae3cc4997ad15f787ea28b3a08 (diff) |
mi: handle sprite even for floating slave devices.
We still don't render it, but we accept all the other calls to update it's
internal state.
-rw-r--r-- | mi/mipointer.c | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/mi/mipointer.c b/mi/mipointer.c index e49b3df50..28f3b4e2e 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -50,7 +50,7 @@ _X_EXPORT DevPrivateKey miPointerScreenKey = &miPointerScreenKey; static DevPrivateKey miPointerPrivKey = &miPointerPrivKey; #define MIPOINTER(dev) \ - ((DevHasCursor((dev))) ? \ + ((DevHasCursor((dev)) || (!dev->isMaster && !dev->u.master)) ? \ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ (miPointerPtr)dixLookupPrivate(&(dev)->u.master->devPrivates, miPointerPrivKey)) @@ -193,9 +193,6 @@ miPointerDisplayCursor (pDev, pScreen, pCursor) { miPointerPtr pPointer; - if (!pDev->isMaster && !pDev->u.master) - return FALSE; - /* return for keyboards */ if ((pDev->isMaster && !DevHasCursor(pDev)) || (!pDev->isMaster && pDev->u.master && !DevHasCursor(pDev->u.master))) @@ -217,9 +214,6 @@ miPointerConstrainCursor (pDev, pScreen, pBox) { miPointerPtr pPointer; - if (!pDev->isMaster && !pDev->u.master) - return; - pPointer = MIPOINTER(pDev); pPointer->limits = *pBox; @@ -313,13 +307,13 @@ miPointerDeviceCleanup(pDev, pScreen) DeviceIntPtr pDev; ScreenPtr pScreen; { - if (DevHasCursor(pDev)) - { - SetupScreen(pScreen); - (*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen); - xfree(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey)); - dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL); - } + if (!pDev->isMaster && pDev->u.master) + return; + + SetupScreen(pScreen); + (*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen); + xfree(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey)); + dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL); } @@ -334,8 +328,6 @@ miPointerWarpCursor (pDev, pScreen, x, y) miPointerPtr pPointer; BOOL changedScreen = FALSE; - if (!pDev->isMaster && !pDev->u.master) - return; pPointer = MIPOINTER(pDev); SetupScreen (pScreen); @@ -388,7 +380,7 @@ miPointerUpdateSprite (DeviceIntPtr pDev) int x, y, devx, devy; miPointerPtr pPointer; - if (!pDev || !pDev->coreEvents || (!pDev->isMaster && !pDev->u.master)) + if (!pDev || !pDev->coreEvents) return; pPointer = MIPOINTER(pDev); @@ -477,10 +469,7 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) { miPointerScreenPtr pScreenPriv; ScreenPtr pScreen; - miPointerPtr pPointer; - - if (!pDev->isMaster && !pDev->u.master) - return; + miPointerPtr pPointer; pPointer = MIPOINTER(pDev); @@ -502,10 +491,8 @@ miPointerCurrentScreen () _X_EXPORT ScreenPtr miPointerGetScreen(DeviceIntPtr pDev) { - if (!pDev || (!pDev->isMaster && !pDev->u.master)) - return NULL; - - return MIPOINTER(pDev)->pScreen; + miPointerPtr pPointer = MIPOINTER(pDev); + return (pPointer) ? pPointer->pScreen : NULL; } /* Move the pointer to x, y on the current screen, update the sprite, and @@ -525,9 +512,6 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, miPointerPtr pPointer; SetupScreen(pScreen); - if (!pDev->isMaster && !pDev->u.master) - return; - pPointer = MIPOINTER(pDev); /* Hack: We mustn't call into ->MoveCursor for anything but the @@ -556,9 +540,6 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time) ScreenPtr newScreen; miPointerPtr pPointer; - - if (!pDev->isMaster && !pDev->u.master) - return; pPointer = MIPOINTER(pDev); pScreen = pPointer->pScreen; @@ -613,12 +594,6 @@ miPointerPosition (int *x, int *y) _X_EXPORT void miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) { - if (!pDev->isMaster && !pDev->u.master) - { - ErrorF("[mi] miPointerGetPosition called for floating device.\n"); - return; - } - *x = MIPOINTER(pDev)->x; *y = MIPOINTER(pDev)->y; } |