diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-22 00:26:28 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-06-03 14:03:23 -0700 |
commit | e7fae9ecc42ab5e73b89117722dbf4117d928f9a (patch) | |
tree | b7897e7a64fe01e3989ec1e7a5a7db69797126e6 /miext/rootless | |
parent | 80b5d3a3264d2c5167e5ac85a3b04af0f89cece1 (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 'miext/rootless')
-rw-r--r-- | miext/rootless/rootlessCommon.c | 4 | ||||
-rw-r--r-- | miext/rootless/rootlessCommon.h | 2 | ||||
-rw-r--r-- | miext/rootless/rootlessScreen.c | 2 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 18 |
4 files changed, 15 insertions, 11 deletions
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c index 39a3eed0f..dd3f953ca 100644 --- a/miext/rootless/rootlessCommon.c +++ b/miext/rootless/rootlessCommon.c @@ -447,7 +447,7 @@ RootlessRedisplay(WindowPtr pWindow) void RootlessRepositionWindows(ScreenPtr pScreen) { - WindowPtr root = WindowTable[pScreen->myNum]; + WindowPtr root = pScreen->root; WindowPtr win; if (root != NULL) { @@ -468,7 +468,7 @@ RootlessRepositionWindows(ScreenPtr pScreen) void RootlessRedisplayScreen(ScreenPtr pScreen) { - WindowPtr root = WindowTable[pScreen->myNum]; + WindowPtr root = pScreen->root; if (root != NULL) { WindowPtr win; diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index f44c4e8cf..8a4b81321 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -213,7 +213,7 @@ extern RegionRec rootlessHugeRoot; // Returns TRUE if this window is a root window #define IsRoot(pWin) \ - ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum]) + ((pWin) == (pWin)->drawable.pScreen->root) /* diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 7a24af842..d24ca04ad 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -493,7 +493,7 @@ static void expose_1 (WindowPtr pWin) { void RootlessScreenExpose (ScreenPtr pScreen) { - expose_1 (WindowTable[pScreen->myNum]); + expose_1 (pScreen->root); } diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 22a548a0f..5955cd99c 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -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) |