aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/saver.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 12:14:52 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 12:14:52 +0000
commit4c61bf84b11e26e6f22648668c95ea760a379163 (patch)
tree0ac762ab2815eae283dded7447ad7cb5a54b926a /xorg-server/Xext/saver.c
parente1dabd2ce8be0d70c6c15353b58de256129dfd1f (diff)
downloadvcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.gz
vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.bz2
vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.zip
xserver git update 11/6/2010
Diffstat (limited to 'xorg-server/Xext/saver.c')
-rw-r--r--xorg-server/Xext/saver.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c
index 0efe5bf2a..7ac437d15 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -226,8 +226,8 @@ MakeScreenPrivate (
ScreenPtr /* pScreen */
);
-static int ScreenPrivateKeyIndex;
-static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKeyIndex;
+static DevPrivateKeyRec ScreenPrivateKeyRec;
+#define ScreenPrivateKey (&ScreenPrivateKeyRec)
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
@@ -252,6 +252,9 @@ ScreenSaverExtensionInit(INITARGS)
int i;
ScreenPtr pScreen;
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
"SaverEvent");
@@ -285,7 +288,7 @@ CheckScreenPrivate (ScreenPtr pScreen)
{
free(pPriv);
SetScreenPrivate (pScreen, NULL);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
+ pScreen->screensaver.ExternalScreenSaver = NULL;
}
}
@@ -304,7 +307,7 @@ MakeScreenPrivate (ScreenPtr pScreen)
pPriv->hasWindow = FALSE;
pPriv->installedMap = None;
SetScreenPrivate (pScreen, pPriv);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = ScreenSaverHandle;
+ pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle;
return pPriv;
}
@@ -503,8 +506,8 @@ SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
ev.type = ScreenSaverNotify + ScreenSaverEventBase;
ev.state = state;
ev.timestamp = currentTime.milliseconds;
- ev.root = WindowTable[pScreen->myNum]->drawable.id;
- ev.window = savedScreenInfo[pScreen->myNum].wid;
+ ev.root = pScreen->root->drawable.id;
+ ev.window = pScreen->screensaver.wid;
ev.kind = kind;
ev.forced = forced;
WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
@@ -559,7 +562,7 @@ CreateSaverWindow (ScreenPtr pScreen)
Colormap wantMap;
ColormapPtr pCmap;
- pSaver = &savedScreenInfo[pScreen->myNum];
+ pSaver = &pScreen->screensaver;
if (pSaver->pWindow)
{
pSaver->pWindow = NullWindow;
@@ -580,7 +583,7 @@ CreateSaverWindow (ScreenPtr pScreen)
if (GrabInProgress && GrabInProgress != pAttr->client->index)
return FALSE;
- pWin = CreateWindow (pSaver->wid, WindowTable[pScreen->myNum],
+ pWin = CreateWindow (pSaver->wid, pScreen->root,
pAttr->x, pAttr->y, pAttr->width, pAttr->height,
pAttr->borderWidth, pAttr->class,
pAttr->mask, (XID *)pAttr->values,
@@ -672,7 +675,7 @@ DestroySaverWindow (ScreenPtr pScreen)
if (!pPriv || !pPriv->hasWindow)
return FALSE;
- pSaver = &savedScreenInfo[pScreen->myNum];
+ pSaver = &pScreen->screensaver;
if (pSaver->pWindow)
{
pSaver->pWindow = NullWindow;
@@ -756,7 +759,7 @@ ProcScreenSaverQueryInfo (ClientPtr client)
if (rc != Success)
return rc;
- pSaver = &savedScreenInfo[pDraw->pScreen->myNum];
+ pSaver = &pDraw->pScreen->screensaver;
pPriv = GetScreenPrivate (pDraw->pScreen);
UpdateCurrentTime ();
@@ -866,7 +869,7 @@ ScreenSaverSetAttributes (ClientPtr client)
if (ret != Success)
return ret;
pScreen = pDraw->pScreen;
- pParent = WindowTable[pScreen->myNum];
+ pParent = pScreen->root;
ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
if (ret != Success)