diff options
author | marha <marha@users.sourceforge.net> | 2011-03-15 22:49:12 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-15 22:49:12 +0000 |
commit | 8285341e69cd721c6871b553e45437c767200545 (patch) | |
tree | 551508bddc84d1c16c15d961878cd2d2f6edb365 /xorg-server/mi | |
parent | 52b8618bfdaa4725fc403f50fe682d02e7f16435 (diff) | |
parent | 5e633abcca598289d0423d89bb400b41e6417259 (diff) | |
download | vcxsrv-8285341e69cd721c6871b553e45437c767200545.tar.gz vcxsrv-8285341e69cd721c6871b553e45437c767200545.tar.bz2 vcxsrv-8285341e69cd721c6871b553e45437c767200545.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/mi')
-rw-r--r-- | xorg-server/mi/mipointer.c | 12 | ||||
-rw-r--r-- | xorg-server/mi/mipointer.h | 1 | ||||
-rw-r--r-- | xorg-server/mi/misprite.c | 41 |
3 files changed, 31 insertions, 23 deletions
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index bbb32f745..e8ed106ea 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -272,6 +272,9 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, pPointer->generateEvent = generateEvent;
+ if (pScreen->ConstrainCursorHarder)
+ pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y);
+
/* device dependent - must pend signal and call miPointerWarpCursor */
(*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
if (!generateEvent)
@@ -560,14 +563,18 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen, * This function is called during the pointer update path in
* GetPointerEvents and friends (and the same in the xwin DDX).
*
+ * The coordinates provided are always absolute. The parameter mode whether
+ * it was relative or absolute movement that landed us at those coordinates.
+ *
* @param pDev The device to move
+ * @param mode Movement mode (Absolute or Relative)
* @param[in,out] x The x coordiante in screen coordinates (in regards to total
* desktop size)
* @param[in,out] y The y coordiante in screen coordinates (in regards to total
* desktop size)
*/
void
-miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
+miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
{
miPointerScreenPtr pScreenPriv;
ScreenPtr pScreen;
@@ -612,6 +619,9 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) if (*y >= pPointer->limits.y2)
*y = pPointer->limits.y2 - 1;
+ if (pScreen->ConstrainCursorHarder)
+ pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y);
+
if (pPointer->x == *x && pPointer->y == *y &&
pPointer->pScreen == pScreen)
return;
diff --git a/xorg-server/mi/mipointer.h b/xorg-server/mi/mipointer.h index caf505019..426ef1650 100644 --- a/xorg-server/mi/mipointer.h +++ b/xorg-server/mi/mipointer.h @@ -133,6 +133,7 @@ extern _X_EXPORT void miPointerGetPosition( * x and y are modified in-place. */
extern _X_EXPORT void miPointerSetPosition(
DeviceIntPtr pDev,
+ int mode,
int *x,
int *y);
diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c index 9df6c1fb1..64c6ce47b 100644 --- a/xorg-server/mi/misprite.c +++ b/xorg-server/mi/misprite.c @@ -308,7 +308,7 @@ miSpriteInitialize (ScreenPtr pScreen, if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
- if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, 0))
+ if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec)))
return FALSE;
pScreenPriv = malloc(sizeof (miSpriteScreenRec));
@@ -863,38 +863,35 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) static Bool
miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miCursorInfoPtr pCursorInfo;
- int ret = FALSE;
-
- pCursorInfo = malloc(sizeof(miCursorInfoRec));
- if (!pCursorInfo)
- return FALSE;
-
- pCursorInfo->pCursor = NULL;
- pCursorInfo->x = 0;
- pCursorInfo->y = 0;
- pCursorInfo->isUp = FALSE;
- pCursorInfo->shouldBeUp = FALSE;
- pCursorInfo->pCacheWin = NullWindow;
- pCursorInfo->isInCacheWin = FALSE;
- pCursorInfo->checkPixels = TRUE;
- pCursorInfo->pScreen = FALSE;
+ int ret = miDCDeviceInitialize(pDev, pScreen);
- ret = miDCDeviceInitialize(pDev, pScreen);
- if (!ret)
+ if (ret)
{
- free(pCursorInfo);
- pCursorInfo = NULL;
+ miCursorInfoPtr pCursorInfo;
+ pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+ pCursorInfo->pCursor = NULL;
+ pCursorInfo->x = 0;
+ pCursorInfo->y = 0;
+ pCursorInfo->isUp = FALSE;
+ pCursorInfo->shouldBeUp = FALSE;
+ pCursorInfo->pCacheWin = NullWindow;
+ pCursorInfo->isInCacheWin = FALSE;
+ pCursorInfo->checkPixels = TRUE;
+ pCursorInfo->pScreen = FALSE;
}
- dixSetPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey, pCursorInfo);
+
return ret;
}
static void
miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
+ miCursorInfoPtr pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+
if (DevHasCursor(pDev))
miDCDeviceCleanup(pDev, pScreen);
+
+ memset(pCursorInfo, 0, sizeof(miCursorInfoRec));
}
/*
|