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 298f09042..910bb2e9a 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -232,8 +232,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))
@@ -258,6 +258,9 @@ ScreenSaverExtensionInit(INITARGS)
int i;
ScreenPtr pScreen;
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
"SaverEvent");
@@ -291,7 +294,7 @@ CheckScreenPrivate (ScreenPtr pScreen)
{
free(pPriv);
SetScreenPrivate (pScreen, NULL);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
+ pScreen->screensaver.ExternalScreenSaver = NULL;
}
}
@@ -310,7 +313,7 @@ MakeScreenPrivate (ScreenPtr pScreen)
pPriv->hasWindow = FALSE;
pPriv->installedMap = None;
SetScreenPrivate (pScreen, pPriv);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = ScreenSaverHandle;
+ pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle;
return pPriv;
}
@@ -509,8 +512,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);
@@ -565,7 +568,7 @@ CreateSaverWindow (ScreenPtr pScreen)
Colormap wantMap;
ColormapPtr pCmap;
- pSaver = &savedScreenInfo[pScreen->myNum];
+ pSaver = &pScreen->screensaver;
if (pSaver->pWindow)
{
pSaver->pWindow = NullWindow;
@@ -586,7 +589,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,
@@ -678,7 +681,7 @@ DestroySaverWindow (ScreenPtr pScreen)
if (!pPriv || !pPriv->hasWindow)
return FALSE;
- pSaver = &savedScreenInfo[pScreen->myNum];
+ pSaver = &pScreen->screensaver;
if (pSaver->pWindow)
{
pSaver->pWindow = NullWindow;
@@ -762,7 +765,7 @@ ProcScreenSaverQueryInfo (ClientPtr client)
if (rc != Success)
return rc;
- pSaver = &savedScreenInfo[pDraw->pScreen->myNum];
+ pSaver = &pDraw->pScreen->screensaver;
pPriv = GetScreenPrivate (pDraw->pScreen);
UpdateCurrentTime ();
@@ -872,7 +875,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)