diff options
author | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
commit | a915739887477b28d924ecc8417ee107d125bd6c (patch) | |
tree | c02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/mi/mipointer.c | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2 vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip |
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/mi/mipointer.c')
-rw-r--r-- | xorg-server/mi/mipointer.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index e37316e71..e1f63be4e 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group. #include <dix-config.h> #endif -# define NEED_EVENTS # include <X11/X.h> # include <X11/Xmd.h> # include <X11/Xproto.h> @@ -42,7 +41,7 @@ in this Software without prior written authorization from The Open Group. # include "inputstr.h" static int miPointerScreenKeyIndex; -_X_EXPORT DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex; +DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex; #define GetScreenPrivate(s) ((miPointerScreenPtr) \ dixLookupPrivate(&(s)->devPrivates, miPointerScreenKey)) @@ -52,9 +51,9 @@ static int miPointerPrivKeyIndex; static DevPrivateKey miPointerPrivKey = &miPointerPrivKeyIndex; #define MIPOINTER(dev) \ - ((DevHasCursor((dev)) || (!dev->isMaster && !dev->u.master)) ? \ + ((!IsMaster(dev) && !dev->u.master) ? \ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ - (miPointerPtr)dixLookupPrivate(&(dev)->u.master->devPrivates, miPointerPrivKey)) + (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); @@ -81,7 +80,7 @@ static void miPointerDeviceCleanup(DeviceIntPtr pDev, static EventList* events; /* for WarpPointer MotionNotifies */ -_X_EXPORT Bool +Bool miPointerInitialize (ScreenPtr pScreen, miPointerSpriteFuncPtr spriteFuncs, miPointerScreenFuncPtr screenFuncs, @@ -89,7 +88,7 @@ miPointerInitialize (ScreenPtr pScreen, { miPointerScreenPtr pScreenPriv; - pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec)); + pScreenPriv = xalloc (sizeof (miPointerScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->spriteFuncs = spriteFuncs; @@ -187,8 +186,8 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) miPointerPtr pPointer; /* return for keyboards */ - if ((pDev->isMaster && !DevHasCursor(pDev)) || - (!pDev->isMaster && pDev->u.master && !DevHasCursor(pDev->u.master))) + if ((IsMaster(pDev) && !DevHasCursor(pDev)) || + (!IsMaster(pDev) && pDev->u.master && !DevHasCursor(pDev->u.master))) return FALSE; pPointer = MIPOINTER(pDev); @@ -285,10 +284,11 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { - if (!pDev->isMaster && pDev->u.master) + SetupScreen(pScreen); + + if (!IsMaster(pDev) && pDev->u.master) return; - SetupScreen(pScreen); (*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen); xfree(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey)); dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL); @@ -297,14 +297,14 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) /* Once signals are ignored, the WarpCursor function can call this */ -_X_EXPORT void +void miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { miPointerPtr pPointer; BOOL changedScreen = FALSE; - pPointer = MIPOINTER(pDev); SetupScreen (pScreen); + pPointer = MIPOINTER(pDev); if (pPointer->pScreen != pScreen) { @@ -367,6 +367,9 @@ miPointerUpdateSprite (DeviceIntPtr pDev) pPointer = MIPOINTER(pDev); + if (!pPointer) + return; + pScreen = pPointer->pScreen; if (!pScreen) return; @@ -444,28 +447,19 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) pPointer->limits.y2 = pScreen->height; } -_X_EXPORT ScreenPtr -miPointerCurrentScreen () +ScreenPtr +miPointerCurrentScreen (void) { return miPointerGetScreen(inputInfo.pointer); } -_X_EXPORT ScreenPtr +ScreenPtr miPointerGetScreen(DeviceIntPtr pDev) { miPointerPtr pPointer = MIPOINTER(pDev); return (pPointer) ? pPointer->pScreen : NULL; } -/* Move the pointer to x, y on the current screen, update the sprite, and - * the motion history. Generates no events. Does not return changed x - * and y if they are clipped; use miPointerSetPosition instead. */ -_X_EXPORT void -miPointerAbsoluteCursor (int x, int y, unsigned long time) -{ - miPointerSetPosition(inputInfo.pointer, &x, &y); -} - /* Move the pointer on the current screen, and update the sprite. */ static void miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, @@ -480,7 +474,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, * VCP, as this may cause a non-HW rendered cursor to be rendered during * SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. */ - if ((pDev == inputInfo.pointer || (!pDev->isMaster && pDev->u.master == inputInfo.pointer)) + if ((pDev == inputInfo.pointer || (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) && !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { pPointer->devx = x; @@ -494,7 +488,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, pPointer->pScreen = pScreen; } -_X_EXPORT void +void miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) { miPointerScreenPtr pScreenPriv; @@ -547,7 +541,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) miPointerMoved(pDev, pScreen, *x, *y); } -_X_EXPORT void +void miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) { *x = MIPOINTER(pDev)->x; @@ -590,7 +584,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) darwinEvents_lock(); #endif for (i = 0; i < nevents; i++) - mieqEnqueue(pDev, events[i].event); + mieqEnqueue(pDev, (InternalEvent*)events[i].event); #ifdef XQUARTZ darwinEvents_unlock(); #endif |