[PATCH 5/5] dix: deduplicate SyntheticMotion.

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 29 23:05:32 PST 2009


---
 dix/events.c |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index abee4b9..f677bb6 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -402,15 +402,21 @@ static CARD8 criticalEvents[32] =
     0x7c, 0x30, 0x40			/* key, button, expose, and configure events */
 };
 
+static void
+SyntheticMotion(DeviceIntPtr dev, int x, int y) {
+    int screenno = 0;
+
 #ifdef PANORAMIX
-static void PostNewCursor(DeviceIntPtr pDev);
+    if (!noPanoramiXExtension)
+        screenno = dev->spriteInfo->sprite->screen->myNum;
+#endif
+    PostSyntheticMotion(dev, x, y, screenno,
+            (syncEvents.playingEvents) ?  syncEvents.time.milliseconds : currentTime.milliseconds);
 
-#define SyntheticMotion(dev, x, y) \
-    PostSyntheticMotion(dev, x, y, noPanoramiXExtension ? 0 : \
-                              dev->spriteInfo->sprite->screen->myNum, \
-                        syncEvents.playingEvents ? \
-                          syncEvents.time.milliseconds : \
-                          currentTime.milliseconds);
+}
+
+#ifdef PANORAMIX
+static void PostNewCursor(DeviceIntPtr pDev);
 
 static Bool
 XineramaSetCursorPosition(
@@ -550,14 +556,6 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
     CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL);
 }
 
-#else
-#define SyntheticMotion(dev, x, y) \
-     PostSyntheticMotion(dev, x, y, \
-                         0, \
-                         syncEvents.playingEvents ? \
-                           syncEvents.time.milliseconds : \
-                           currentTime.milliseconds);
-
 #endif  /* PANORAMIX */
 
 void
-- 
1.6.0.6




More information about the xorg mailing list