From 5b2bbffc12cd7d29e4200943f8736bd6336ae4aa Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 30 Jan 2009 16:46:27 +1000 Subject: [PATCH] dix: deduplicate SyntheticMotion. Signed-off-by: Peter Hutterer --- dix/events.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/dix/events.c b/dix/events.c index 97d77305f..77badfd79 100644 --- a/dix/events.c +++ b/dix/events.c @@ -402,16 +402,22 @@ 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 + if (!noPanoramiXExtension) + screenno = dev->spriteInfo->sprite->screen->myNum; +#endif + PostSyntheticMotion(dev, x, y, screenno, + (syncEvents.playingEvents) ? syncEvents.time.milliseconds : currentTime.milliseconds); + +} + #ifdef PANORAMIX static void PostNewCursor(DeviceIntPtr pDev); -#define SyntheticMotion(dev, x, y) \ - PostSyntheticMotion(dev, x, y, noPanoramiXExtension ? 0 : \ - dev->spriteInfo->sprite->screen->myNum, \ - syncEvents.playingEvents ? \ - syncEvents.time.milliseconds : \ - currentTime.milliseconds); - static Bool XineramaSetCursorPosition( DeviceIntPtr pDev, @@ -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