[PATCH] mi: De-duplicate some code in mipointer.c

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 6 15:09:31 PDT 2010


miPointerMoved already has the same code.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
just found this patch on my branch and I must have forgotten to send it to
the list. This one goes in before the rename of miPointerMoved and it was
the one that prompted the rename in the first place.

 mi/mipointer.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/mi/mipointer.c b/mi/mipointer.c
index 9936a01..7efcebb 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -73,6 +73,7 @@ static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen,
 static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
 static void miPointerDeviceCleanup(DeviceIntPtr pDev,
                                    ScreenPtr pScreen);
+static void miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
 
 static EventList* events; /* for WarpPointer MotionNotifies */
 
@@ -305,24 +306,9 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
     }
 
     if (GenerateEvent)
-    {
 	miPointerMove (pDev, pScreen, x, y);
-    }
     else
-    {
-	/* everything from miPointerMove except the event and history */
-
-    	if (!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
-    	{
-	    pPointer->devx = x;
-	    pPointer->devy = y;
-	    if(pPointer->pCursor && !pPointer->pCursor->bits->emptyMask)
-		(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
-    	}
-	pPointer->x = x;
-	pPointer->y = y;
-	pPointer->pScreen = pScreen;
-    }
+        miPointerMoved(pDev, pScreen, x, y);
 
     /* Don't call USFS if we use Xinerama, otherwise the root window is
      * updated to the second screen, and we never receive any events.
-- 
1.7.1



More information about the xorg-devel mailing list