aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/saver.c
diff options
context:
space:
mode:
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)