aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/misprite.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-15 22:49:12 +0000
committermarha <marha@users.sourceforge.net>2011-03-15 22:49:12 +0000
commit8285341e69cd721c6871b553e45437c767200545 (patch)
tree551508bddc84d1c16c15d961878cd2d2f6edb365 /xorg-server/mi/misprite.c
parent52b8618bfdaa4725fc403f50fe682d02e7f16435 (diff)
parent5e633abcca598289d0423d89bb400b41e6417259 (diff)
downloadvcxsrv-8285341e69cd721c6871b553e45437c767200545.tar.gz
vcxsrv-8285341e69cd721c6871b553e45437c767200545.tar.bz2
vcxsrv-8285341e69cd721c6871b553e45437c767200545.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/mi/misprite.c')
-rw-r--r--xorg-server/mi/misprite.c41
1 files changed, 19 insertions, 22 deletions
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));
}
/*