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)
This commit is contained in:
Jamey Sharp
2010-05-22 00:26:28 -07:00
parent 80b5d3a326
commit e7fae9ecc4
52 changed files with 130 additions and 128 deletions

View File

@@ -1517,7 +1517,7 @@ RootlessOrderAllWindows (void)
RL_DEBUG_MSG("RootlessOrderAllWindows() ");
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i] == NULL) continue;
pWin = WindowTable[i];
pWin = screenInfo.screens[i]->root;
if (pWin == NULL) continue;
for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) {
@@ -1533,7 +1533,7 @@ void
RootlessEnableRoot (ScreenPtr pScreen)
{
WindowPtr pRoot;
pRoot = WindowTable[pScreen->myNum];
pRoot = pScreen->root;
RootlessEnsureFrame (pRoot);
(*pScreen->ClearToBackground) (pRoot, 0, 0, 0, 0, TRUE);
@@ -1546,7 +1546,7 @@ RootlessDisableRoot (ScreenPtr pScreen)
WindowPtr pRoot;
RootlessWindowRec *winRec;
pRoot = WindowTable[pScreen->myNum];
pRoot = pScreen->root;
winRec = WINREC (pRoot);
if (NULL == winRec)
@@ -1572,8 +1572,10 @@ RootlessHideAllWindows (void)
for (i = 0; i < screenInfo.numScreens; i++)
{
pScreen = screenInfo.screens[i];
pWin = WindowTable[i];
if (pScreen == NULL || pWin == NULL)
if (pScreen == NULL)
continue;
pWin = pScreen->root;
if (pWin == NULL)
continue;
for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
@@ -1609,8 +1611,10 @@ RootlessShowAllWindows (void)
for (i = 0; i < screenInfo.numScreens; i++)
{
pScreen = screenInfo.screens[i];
pWin = WindowTable[i];
if (pScreen == NULL || pWin == NULL)
if (pScreen == NULL)
continue;
pWin = pScreen->root;
if (pWin == NULL)
continue;
for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)