mi: remove static GenerateEvent variable.

Push into the respective devices. This should have no functional changes
since we never warp more than one device at a time. In the glorious future
with true multithreading, still the better thing to do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
This commit is contained in:
Peter Hutterer 2011-02-11 11:01:19 +10:00
parent 93a7399370
commit 15fe86e69f
2 changed files with 6 additions and 4 deletions

View File

@ -220,15 +220,15 @@ miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
*pTopLeftBox = *pHotBox; *pTopLeftBox = *pHotBox;
} }
static Bool GenerateEvent;
static Bool static Bool
miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, Bool generateEvent) int x, int y, Bool generateEvent)
{ {
SetupScreen (pScreen); SetupScreen (pScreen);
miPointerPtr pPointer = MIPOINTER(pDev);
pPointer->generateEvent = generateEvent;
GenerateEvent = generateEvent;
/* device dependent - must pend signal and call miPointerWarpCursor */ /* device dependent - must pend signal and call miPointerWarpCursor */
(*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y); (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
if (!generateEvent) if (!generateEvent)
@ -261,6 +261,7 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
pPointer->confined = FALSE; pPointer->confined = FALSE;
pPointer->x = 0; pPointer->x = 0;
pPointer->y = 0; pPointer->y = 0;
pPointer->generateEvent = FALSE;
if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen))) if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen)))
{ {
@ -306,7 +307,7 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
changedScreen = TRUE; changedScreen = TRUE;
} }
if (GenerateEvent) if (pPointer->generateEvent)
miPointerMove (pDev, pScreen, x, y); miPointerMove (pDev, pScreen, x, y);
else else
miPointerMoveNoEvent(pDev, pScreen, x, y); miPointerMoveNoEvent(pDev, pScreen, x, y);

View File

@ -44,6 +44,7 @@ typedef struct {
Bool confined; /* pointer can't change screens */ Bool confined; /* pointer can't change screens */
int x, y; /* hot spot location */ int x, y; /* hot spot location */
int devx, devy; /* sprite position */ int devx, devy; /* sprite position */
Bool generateEvent; /* generate an event during warping? */
} miPointerRec, *miPointerPtr; } miPointerRec, *miPointerPtr;
typedef struct { typedef struct {