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 /hw | |
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 'hw')
-rw-r--r-- | hw/dmx/dmxextension.c | 16 | ||||
-rw-r--r-- | hw/dmx/input/dmxconsole.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/dmxinputinit.c | 2 | ||||
-rw-r--r-- | hw/kdrive/src/kdrive.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Helper.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86RandR.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.c | 2 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86vmode.c | 2 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 2 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 2 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 6 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaCpyWin.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaOverlay.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaOverlayDF.c | 2 | ||||
-rw-r--r-- | hw/xquartz/darwin.c | 2 | ||||
-rw-r--r-- | hw/xquartz/quartz.c | 2 | ||||
-rw-r--r-- | hw/xquartz/xpr/xprFrame.c | 2 | ||||
-rw-r--r-- | hw/xquartz/xpr/xprScreen.c | 4 | ||||
-rw-r--r-- | hw/xwin/winkeybd.c | 2 | ||||
-rwxr-xr-x | hw/xwin/winwin32rootlesswindow.c | 2 | ||||
-rw-r--r-- | hw/xwin/winwindow.c | 2 |
22 files changed, 33 insertions, 33 deletions
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index c8e8dae65..678f29054 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -297,7 +297,7 @@ void dmxFlushPendingSyncs(void) void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; WindowPtr pChild; Bool anyMarked = FALSE; @@ -402,7 +402,7 @@ static void dmxConfigureScreenWindow(int idx, static void dmxConfigureRootWindow(int idx, int x, int y, int w, int h) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; - WindowPtr pRoot = WindowTable[idx]; + WindowPtr pRoot = screenInfo.screens[idx]->root; /* NOTE: Either this function or the ones that it calls must handle * the case where w == 0 || h == 0. Currently, the functions that @@ -437,7 +437,7 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; ScreenPtr pScreen = screenInfo.screens[idx]; - WindowPtr pRoot = WindowTable[idx]; + WindowPtr pRoot = pScreen->root; WindowPtr pChild; int xoff; int yoff; @@ -458,7 +458,7 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y) XineramaReinitData(pScreen); /* Adjust each of the root window's children */ - if (!idx) ReinitializeRootWindow(WindowTable[0], xoff, yoff); + if (!idx) ReinitializeRootWindow(screenInfo.screens[0]->root, xoff, yoff); pChild = pRoot->firstChild; while (pChild) { /* Adjust child window's position */ @@ -634,7 +634,7 @@ int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs) int i; for (i = 0; i < dmxNumScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; - WindowPtr pChild = WindowTable[i]->firstChild; + WindowPtr pChild = pScreen->root->firstChild; while (pChild) { /* Adjust child window's position */ pScreen->MoveWindow(pChild, @@ -914,7 +914,7 @@ static void dmxBECreateResources(pointer value, XID id, RESTYPE type, static void dmxBECreateWindowTree(int idx) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; - WindowPtr pRoot = WindowTable[idx]; + WindowPtr pRoot = screenInfo.screens[idx]->root; dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pRoot); WindowPtr pWin; @@ -982,7 +982,7 @@ static void dmxBECreateWindowTree(int idx) static void dmxForceExposures(int idx) { ScreenPtr pScreen = screenInfo.screens[idx]; - WindowPtr pRoot = WindowTable[idx]; + WindowPtr pRoot = pScreen->root; Bool anyMarked = FALSE; WindowPtr pChild; @@ -1510,7 +1510,7 @@ static void dmxBEDestroyScratchGCs(int scrnNum) * destroy a window as well as all of it's children. */ static void dmxBEDestroyWindowTree(int idx) { - WindowPtr pWin = WindowTable[idx]; + WindowPtr pWin = screenInfo.screens[idx]->root; WindowPtr pChild = pWin; while (1) { diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c index 9542efacd..bf34169ab 100644 --- a/hw/dmx/input/dmxconsole.c +++ b/hw/dmx/input/dmxconsole.c @@ -204,7 +204,7 @@ static void dmxConsoleDrawWindows(pointer private) XUnionRectWithRegion(&rect, whole, whole); for (i = 0; i < dmxNumScreens; i++) { - WindowPtr pRoot = WindowTable[i]; + WindowPtr pRoot = screenInfo.screens[i]->root; WindowPtr pChild; #if DMX_WINDOW_DEBUG diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index 1242be1bd..814fc1a89 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -570,7 +570,7 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput, int i; #ifdef PANORAMIX - if (!noPanoramiXExtension && pWindow && pWindow->parent != WindowTable[0]) + if (!noPanoramiXExtension && pWindow && pWindow->parent != screenInfo.screens[0]->root) return; #endif #if DMX_WINDOW_DEBUG diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 9d1b38376..10df02dbc 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -95,7 +95,7 @@ KdOsFuncs *kdOsFuncs; void KdSetRootClip (ScreenPtr pScreen, BOOL enable) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; WindowPtr pChild; Bool WasViewable; Bool anyMarked = FALSE; diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index d4b935157..1aad2d100 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1062,7 +1062,7 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen) static void xf86SetRootClip (ScreenPtr pScreen, Bool enable) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = FALSE; diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 455a02cc2..77053b8c2 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -159,7 +159,7 @@ xf86RandRSetMode (ScreenPtr pScreen, int oldmmHeight = pScreen->mmHeight; int oldVirtualX = scrp->virtualX; int oldVirtualY = scrp->virtualY; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; Bool ret = TRUE; if (pRoot && scrp->vtSema) diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 2b33f2585..efed677af 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -1881,7 +1881,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) void xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) { - DrawablePtr root = &WindowTable[pScreen->myNum]->drawable; + DrawablePtr root = &pScreen->root->drawable; ChangeGCVal pval[2]; BoxPtr pbox = REGION_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes); diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 754fe372c..448762879 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -347,7 +347,7 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced) ev.type = XF86VidModeNotify + XF86VidModeEventBase; ev.state = state; ev.timestamp = currentTime.milliseconds; - ev.root = WindowTable[pScreen->myNum]->drawable.id; + ev.root = pScreen->root->drawable.id; ev.kind = kind; ev.forced = forced; WriteEventsToClient (pEv->client, 1, (xEvent *) &ev); diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 77f7fe295..f7cea5ede 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1187,7 +1187,7 @@ DRIDriverClipNotify(ScreenPtr pScreen) if (pDRIPriv->nrWindows > 0) { pDRIPriv->nrWalked = 0; - TraverseTree(WindowTable[pScreen->myNum], DRIDCNTreeTraversal, + TraverseTree(pScreen->root, DRIDCNTreeTraversal, (pointer)pDRIWindows); } diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 556285383..9ec4caa54 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -607,7 +607,7 @@ DRI2CanFlip(DrawablePtr pDraw) if (pDraw->type == DRAWABLE_PIXMAP) return TRUE; - pRoot = WindowTable[pScreen->myNum]; + pRoot = pScreen->root; pRootPixmap = pScreen->GetWindowPixmap(pRoot); pWin = (WindowPtr) pDraw; diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 9dfce3fed..8d598d6e7 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -517,7 +517,7 @@ xf86RandR12SetMode (ScreenPtr pScreen, int oldHeight = pScreen->height; int oldmmWidth = pScreen->mmWidth; int oldmmHeight = pScreen->mmHeight; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; DisplayModePtr currentMode = NULL; Bool ret = TRUE; PixmapPtr pspix = NULL; @@ -685,7 +685,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen); Bool ret = FALSE; int c; @@ -739,7 +739,7 @@ finish: if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); #if RANDR_12_INTERFACE - if (xf86RandR12Key && WindowTable[pScreen->myNum] && ret) + if (xf86RandR12Key && pScreen->root && ret) RRScreenSizeNotify (pScreen); #endif return ret; diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 2714fee51..e3683a8ed 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -76,9 +76,9 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) { ScrnInfoPtr scrn = crtc->scrn; ScreenPtr screen = scrn->pScreen; - WindowPtr root = WindowTable[screen->myNum]; + WindowPtr root = screen->root; PixmapPtr dst_pixmap = crtc->rotatedPixmap; - PictFormatPtr format = compWindowFormat (WindowTable[screen->myNum]); + PictFormatPtr format = compWindowFormat (screen->root); int error; PicturePtr src, dst; int n = REGION_NUM_RECTS(region); diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c index d37c8ec1e..d58db8ea1 100644 --- a/hw/xfree86/xaa/xaaCpyWin.c +++ b/hw/xfree86/xaa/xaaCpyWin.c @@ -47,7 +47,7 @@ XAACopyWindow( return; } - pwinRoot = WindowTable[pScreen->myNum]; + pwinRoot = pScreen->root; REGION_NULL(pScreen, &rgnDst); diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 2af808396..14de9bd34 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -54,7 +54,7 @@ XAACopyWindow8_32( return; } - pwinRoot = WindowTable[pScreen->myNum]; + pwinRoot = pScreen->root; if(doUnderlay) freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip); diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index 3b848ac84..b186cb5cd 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -324,7 +324,7 @@ XAAOverCopyWindow( RegionRec rgnDst; BoxPtr pbox; int i, nbox, dx, dy; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) { diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 580fe4ae0..825afa0de 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -793,7 +793,7 @@ void AbortDDX( void ) void xf86SetRootClip (ScreenPtr pScreen, int enable) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = TRUE; diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 36d18eba3..ac7fedd13 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -276,7 +276,7 @@ void QuartzUpdateScreens(void) { sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; /* Adjust the root window. */ - pRoot = WindowTable[pScreen->myNum]; + pRoot = pScreen->root; AppleWMSetScreenOrigin(pRoot); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c index 53dde7acc..6dc2c87fa 100644 --- a/hw/xquartz/xpr/xprFrame.c +++ b/hw/xquartz/xpr/xprFrame.c @@ -576,7 +576,7 @@ xprHideWindows(Bool hide) for (screen = 0; screen < screenInfo.numScreens; screen++) { RootlessFrameID prevWid = NULL; - pRoot = WindowTable[screenInfo.screens[screen]->myNum]; + pRoot = screenInfo.screens[screen]->root; for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) { RootlessWindowRec *winRec = WINREC(pWin); diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c index d574721b3..87e97d4e2 100644 --- a/hw/xquartz/xpr/xprScreen.c +++ b/hw/xquartz/xpr/xprScreen.c @@ -397,7 +397,7 @@ xprUpdateScreen(ScreenPtr pScreen) rootlessGlobalOffsetX = darwinMainScreenX; rootlessGlobalOffsetY = darwinMainScreenY; - AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]); + AppleWMSetScreenOrigin(pScreen->root); RootlessRepositionWindows(pScreen); RootlessUpdateScreenPixmap(pScreen); @@ -416,7 +416,7 @@ xprInitInput(int argc, char **argv) rootlessGlobalOffsetY = darwinMainScreenY; for (i = 0; i < screenInfo.numScreens; i++) - AppleWMSetScreenOrigin(WindowTable[i]); + AppleWMSetScreenOrigin(screenInfo.screens[i]->root); } /* diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index ad9e66a0b..6d91ce0d6 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -262,7 +262,7 @@ winRestoreModeKeyStates (void) /* Only process events if the rootwindow is mapped. The keyboard events * will cause segfaults otherwise */ - if (WindowTable && WindowTable[0] && WindowTable[0]->mapped == FALSE) + if (screenInfo.screens[0]->root && screenInfo.screens[0]->root->mapped == FALSE) processEvents = FALSE; /* Force to process all pending events in the mi event queue */ diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c index 3a49ead69..214e8954b 100755 --- a/hw/xwin/winwin32rootlesswindow.c +++ b/hw/xwin/winwin32rootlesswindow.c @@ -407,7 +407,7 @@ void winMWExtWMRestackWindows (ScreenPtr pScreen) { winScreenPriv(pScreen); - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; WindowPtr pWin = NULL; WindowPtr pWinPrev = NULL; win32RootlessWindowPtr pRLWin = NULL; diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index d0c360f34..9348d5c1c 100644 --- a/hw/xwin/winwindow.c +++ b/hw/xwin/winwindow.c @@ -144,7 +144,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, #endif /* Get a pointer to the root window */ - pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; + pwinRoot = pWin->drawable.pScreen->root; /* Create a region for the destination */ prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); |