summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-22 00:26:28 -0700
committerJamey Sharp <jamey@minilop.net>2010-06-03 14:03:23 -0700
commite7fae9ecc42ab5e73b89117722dbf4117d928f9a (patch)
treeb7897e7a64fe01e3989ec1e7a5a7db69797126e6 /Xext
parent80b5d3a3264d2c5167e5ac85a3b04af0f89cece1 (diff)
Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
Diffstat (limited to 'Xext')
-rw-r--r--Xext/panoramiX.c2
-rw-r--r--Xext/panoramiXprocs.c14
-rw-r--r--Xext/saver.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 594da0e95..e1cef87a5 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -837,7 +837,7 @@ PanoramiXConsolidate(void)
for (i = 0; i < PanoramiXNumScreens; i++) {
ScreenPtr pScreen = screenInfo.screens[i];
- root->info[i].id = WindowTable[i]->drawable.id;
+ root->info[i].id = pScreen->root->drawable.id;
root->u.win.class = InputOutput;
root->u.win.root = TRUE;
saver->info[i].id = pScreen->screensaver.wid;
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 08ea3ec90..6b199cf7b 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -129,7 +129,7 @@ int PanoramiXCreateWindow(ClientPtr client)
orig_visual = stuff->visual;
orig_x = stuff->x;
orig_y = stuff->y;
- parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
+ parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) ||
(stuff->parent == screenInfo.screens[0]->screensaver.wid);
FOR_NSCREENS_BACKWARD(j) {
stuff->wid = newWin->info[j].id;
@@ -328,7 +328,7 @@ int PanoramiXReparentWindow(ClientPtr client)
x = stuff->x;
y = stuff->y;
- parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
+ parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) ||
(stuff->parent == screenInfo.screens[0]->screensaver.wid);
FOR_NSCREENS_BACKWARD(j) {
stuff->window = win->info[j].id;
@@ -475,7 +475,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
}
}
- if(pWin->parent && ((pWin->parent == WindowTable[0]) ||
+ if(pWin->parent && ((pWin->parent == screenInfo.screens[0]->root) ||
(pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid)))
{
if ((Mask)stuff->mask & CWX) {
@@ -544,7 +544,7 @@ int PanoramiXGetGeometry(ClientPtr client)
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
- rep.root = WindowTable[0]->drawable.id;
+ rep.root = screenInfo.screens[0]->root->drawable.id;
rep.depth = pDraw->depth;
rep.width = pDraw->width;
rep.height = pDraw->height;
@@ -562,7 +562,7 @@ int PanoramiXGetGeometry(ClientPtr client)
WindowPtr pWin = (WindowPtr)pDraw;
rep.x = pWin->origin.x - wBorderWidth (pWin);
rep.y = pWin->origin.y - wBorderWidth (pWin);
- if((pWin->parent == WindowTable[0]) ||
+ if((pWin->parent == screenInfo.screens[0]->root) ||
(pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid))
{
rep.x += panoramiXdataPtr[0].x;
@@ -596,7 +596,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
rep.sameScreen = xTrue;
rep.child = None;
- if((pWin == WindowTable[0]) ||
+ if((pWin == screenInfo.screens[0]->root) ||
(pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
{
x = stuff->srcX - panoramiXdataPtr[0].x;
@@ -634,7 +634,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
}
rep.dstX = x - pDst->drawable.x;
rep.dstY = y - pDst->drawable.y;
- if((pDst == WindowTable[0]) ||
+ if((pDst == screenInfo.screens[0]->root) ||
(pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
{
rep.dstX += panoramiXdataPtr[0].x;
diff --git a/Xext/saver.c b/Xext/saver.c
index da61fbe60..696c4aa22 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -503,7 +503,7 @@ 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.root = pScreen->root->drawable.id;
ev.window = pScreen->screensaver.wid;
ev.kind = kind;
ev.forced = forced;
@@ -580,7 +580,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,
@@ -866,7 +866,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)