[PATCH 01/20] mi: remove static GenerateEvent variable.

Peter Hutterer peter.hutterer at who-t.net
Thu Feb 17 19:52:08 PST 2011


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 at who-t.net>
---
 mi/mipointer.c  |    9 +++++----
 mi/mipointrst.h |    1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/mi/mipointer.c b/mi/mipointer.c
index 554397a..5ee456c 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -220,15 +220,15 @@ miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
     *pTopLeftBox = *pHotBox;
 }
 
-static Bool GenerateEvent;
-
 static Bool
 miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
                            int x, int y, Bool generateEvent)
 {
     SetupScreen (pScreen);
+    miPointerPtr pPointer = MIPOINTER(pDev);
+
+    pPointer->generateEvent = generateEvent;
 
-    GenerateEvent = generateEvent;
     /* device dependent - must pend signal and call miPointerWarpCursor */
     (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
     if (!generateEvent)
@@ -261,6 +261,7 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
     pPointer->confined = FALSE;
     pPointer->x = 0;
     pPointer->y = 0;
+    pPointer->generateEvent = FALSE;
 
     if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen)))
     {
@@ -306,7 +307,7 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
         changedScreen = TRUE;
     }
 
-    if (GenerateEvent)
+    if (pPointer->generateEvent)
 	miPointerMove (pDev, pScreen, x, y);
     else
         miPointerMoveNoEvent(pDev, pScreen, x, y);
diff --git a/mi/mipointrst.h b/mi/mipointrst.h
index bd9c24a..c912a17 100644
--- a/mi/mipointrst.h
+++ b/mi/mipointrst.h
@@ -44,6 +44,7 @@ typedef struct {
     Bool		    confined;	/* pointer can't change screens */
     int			    x, y;	/* hot spot location */
     int			    devx, devy;	/* sprite position */
+    Bool		    generateEvent; /* generate an event during warping? */
 } miPointerRec, *miPointerPtr;
 
 typedef struct {
-- 
1.7.4



More information about the xorg-devel mailing list