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 | |
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)
52 files changed, 130 insertions, 128 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 594da0e95..e1cef87a5 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -834,13 +834,13 @@ PanoramiXConsolidate(void) defmap->type = XRT_COLORMAP; saver = malloc(sizeof(PanoramiXRes)); saver->type = XRT_WINDOW; 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; saver->u.win.class = InputOutput; saver->u.win.root = TRUE; defmap->info[i].id = pScreen->defColormap; diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 08ea3ec90..6b199cf7b 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -126,13 +126,13 @@ int PanoramiXCreateWindow(ClientPtr client) if (stuff->class == InputOnly) stuff->visual = CopyFromParent; 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; stuff->parent = parent->info[j].id; if (parentIsRoot) { stuff->x = orig_x - panoramiXdataPtr[j].x; @@ -325,13 +325,13 @@ int PanoramiXReparentWindow(ClientPtr client) XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; 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; stuff->parent = parent->info[j].id; if(parentIsRoot) { stuff->x = x - panoramiXdataPtr[j].x; @@ -472,13 +472,13 @@ int PanoramiXConfigureWindow(ClientPtr client) client, DixReadAccess); if (result != Success) return result; } } - 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) { x_offset = 0; x = *((CARD32 *)&stuff[1]); } @@ -541,13 +541,13 @@ int PanoramiXGetGeometry(ClientPtr client) if (rc != Success) return rc; 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; rep.x = rep.y = rep.borderWidth = 0; if (stuff->id == rep.root) { @@ -559,13 +559,13 @@ int PanoramiXGetGeometry(ClientPtr client) } else if ((pDraw->type == UNDRAWABLE_WINDOW) || (pDraw->type == DRAWABLE_WINDOW)) { 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; rep.y += panoramiXdataPtr[0].y; } rep.borderWidth = pWin->borderWidth; @@ -593,13 +593,13 @@ int PanoramiXTranslateCoords(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; 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; y = stuff->srcY - panoramiXdataPtr[0].y; } else { x = pWin->drawable.x + stuff->srcX; @@ -631,13 +631,13 @@ int PanoramiXTranslateCoords(ClientPtr client) } else pWin = pWin->nextSib; } 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; rep.dstY += panoramiXdataPtr[0].y; } diff --git a/Xext/saver.c b/Xext/saver.c index da61fbe60..696c4aa22 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -500,13 +500,13 @@ SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced) { if (!(pEv->mask & mask)) continue; 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; WriteEventsToClient (pEv->client, 1, (xEvent *) &ev); } } @@ -577,13 +577,13 @@ CreateSaverWindow (ScreenPtr pScreen) pPriv->installedMap = None; 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, pAttr->depth, serverClient, pAttr->visual, &result); if (!pWin) @@ -863,13 +863,13 @@ ScreenSaverSetAttributes (ClientPtr client) REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq); ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); 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) return ret; len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq)); diff --git a/Xi/closedev.c b/Xi/closedev.c index 159ead55c..e319c737a 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -153,13 +153,13 @@ ProcXCloseDevice(ClientPtr client) /* Remove event selections from all windows for events from this device * and selected by this client. * Delete passive grabs from all windows for this device. */ for (i = 0; i < screenInfo.numScreens; i++) { - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; DeleteDeviceEvents(d, pWin, client); p1 = pWin->firstChild; DeleteEventsFromChildren(d, p1, client); } CloseInputDevice(d, client); diff --git a/Xi/exevents.c b/Xi/exevents.c index 41b396c28..56d9bf7fd 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -923,13 +923,13 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device) ErrorF("[Xi] %s: XI2 conversion failed in ProcessRawEvent (%d)\n", device->name, i); return; } for (i = 0; i < screenInfo.numScreens; i++) - DeliverEventsToWindow(device, WindowTable[i], xi, 1, + DeliverEventsToWindow(device, screenInfo.screens[i]->root, xi, 1, GetEventFilter(device, xi), NULL); free(xi); } } /** @@ -1039,13 +1039,13 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) if (DeviceEventCallback && !syncEvents.playingEvents) { DeviceEventInfoRec eventinfo; SpritePtr pSprite = device->spriteInfo->sprite; /* see comment in EnqueueEvents regarding the next three lines */ if (ev->any.type == ET_Motion) - ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id; + ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id; eventinfo.device = device; eventinfo.event = ev; CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo); } @@ -2117,13 +2117,13 @@ void SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count) { int i; WindowPtr pWin, p1; for (i = 0; i < screenInfo.numScreens; i++) { - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; if (!pWin) continue; DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab); p1 = pWin->firstChild; FindInterestedChildren(dev, p1, mask, ev, count); } diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c index e72cfac03..215339331 100644 --- a/Xi/xichangecursor.c +++ b/Xi/xichangecursor.c @@ -90,13 +90,13 @@ int ProcXIChangeCursor(ClientPtr client) if (rc != Success) return rc; } if (stuff->cursor == None) { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) + if (pWin == pWin->drawable.pScreen->root) pCursor = rootCursor; else pCursor = (CursorPtr)None; } else { diff --git a/composite/compinit.c b/composite/compinit.c index a81cc740f..e4b68c822 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -138,13 +138,13 @@ compScreenUpdate (ScreenPtr pScreen) { CompScreenPtr cs = GetCompScreen (pScreen); compCheckTree (pScreen); if (cs->damaged) { - compWindowUpdate (WindowTable[pScreen->myNum]); + compWindowUpdate (pScreen->root); cs->damaged = FALSE; } } static void compBlockHandler (int i, diff --git a/composite/compoverlay.c b/composite/compoverlay.c index 2158cdb5a..67b566c7f 100644 --- a/composite/compoverlay.c +++ b/composite/compoverlay.c @@ -121,13 +121,13 @@ compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient) * Create the overlay window and map it */ Bool compCreateOverlayWindow (ScreenPtr pScreen) { CompScreenPtr cs = GetCompScreen(pScreen); - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; WindowPtr pWin; XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */ int result; pWin = cs->pOverlayWin = CreateWindow (cs->overlayWid, pRoot, diff --git a/dix/devices.c b/dix/devices.c index 250a4980d..998d22a4b 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -357,15 +357,15 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) { if (IsMaster(dev)) { /* Sprites appear on first root window, so we can hardcode it */ if (dev->spriteInfo->spriteOwner) { - InitializeSprite(dev, WindowTable[0]); + InitializeSprite(dev, screenInfo.screens[0]->root); /* mode doesn't matter */ - EnterWindow(dev, WindowTable[0], NotifyAncestor); + EnterWindow(dev, screenInfo.screens[0]->root, NotifyAncestor); } else if ((other = NextFreePointerDevice()) == NULL) { ErrorF("[dix] cannot find pointer to pair with. " "This is a bug.\n"); return FALSE; @@ -2432,13 +2432,13 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) { WindowPtr currentRoot; if (dev->spriteInfo->sprite) currentRoot = dev->spriteInfo->sprite->spriteTrace[0]; else /* new device auto-set to floating */ - currentRoot = WindowTable[0]; + currentRoot = screenInfo.screens[0]->root; /* we need to init a fake sprite */ screen = currentRoot->drawable.pScreen; screen->DeviceCursorInitialize(dev, screen); dev->spriteInfo->sprite = NULL; InitializeSprite(dev, currentRoot); diff --git a/dix/dispatch.c b/dix/dispatch.c index 27cb22022..c0efce5bf 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -559,13 +559,13 @@ CreateConnectionBlock(void) { ScreenPtr pScreen; DepthPtr pDepth; VisualPtr pVisual; pScreen = screenInfo.screens[i]; - root.windowId = WindowTable[i]->drawable.id; + root.windowId = pScreen->root->drawable.id; root.defaultColormap = pScreen->defColormap; root.whitePixel = pScreen->whitePixel; root.blackPixel = pScreen->blackPixel; root.currentInputMask = 0; /* filled in when sent */ root.pixWidth = pScreen->width; root.pixHeight = pScreen->height; @@ -909,13 +909,13 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep) if (rc != Success) return rc; rep->type = X_Reply; rep->length = 0; rep->sequenceNumber = client->sequence; - rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id; + rep->root = pDraw->pScreen->root->drawable.id; rep->depth = pDraw->depth; rep->width = pDraw->width; rep->height = pDraw->height; /* XXX - Because the pixmap-implementation of the multibuffer extension * may have the buffer-id's drawable resource value be a pointer @@ -969,13 +969,13 @@ ProcQueryTree(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); if (rc != Success) return rc; memset(&reply, 0, sizeof(xQueryTreeReply)); reply.type = X_Reply; - reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + reply.root = pWin->drawable.pScreen->root->drawable.id; reply.sequenceNumber = client->sequence; if (pWin->parent) reply.parent = pWin->parent->drawable.id; else reply.parent = (Window)None; pHead = RealChildHead(pWin); @@ -2052,13 +2052,13 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, relx -= pPix->screen_x; rely -= pPix->screen_y; #endif } else { - pBoundingDraw = (DrawablePtr)WindowTable[pDraw->pScreen->myNum]; + pBoundingDraw = (DrawablePtr)pDraw->pScreen->root; } xgi.visual = wVisual (pWin); } else { @@ -3663,15 +3663,15 @@ SendConnSetup(ClientPtr client, char *reason) #endif for (i=0; i<numScreens; i++) { unsigned int j; xDepth *pDepth; + WindowPtr pRoot = screenInfo.screens[i]->root; - root->currentInputMask = WindowTable[i]->eventMask | - wOtherEventMasks (WindowTable[i]); + root->currentInputMask = pRoot->eventMask | wOtherEventMasks(pRoot); pDepth = (xDepth *)(root + 1); for (j = 0; j < root->nDepths; j++) { pDepth = (xDepth *)(((char *)(pDepth + 1)) + pDepth->nVisuals * sizeof(xVisualType)); } @@ -3913,13 +3913,12 @@ AddScreen( This is also where the default colormap should be allocated and also pixel values for blackPixel, whitePixel, and the cursor Note that InitScreen is NOT allowed to modify argc, argv, or any of the strings pointed to by argv. They may be passed to multiple screens. */ - WindowTable[i] = NullWindow; screenInfo.screens[i] = pScreen; screenInfo.numScreens++; if (!(*pfnInit)(i, pScreen, argc, argv)) { dixFreePrivates(pScreen->devPrivates); free(pScreen); diff --git a/dix/enterleave.c b/dix/enterleave.c index c08cc3100..eefa7ab8e 100644 --- a/dix/enterleave.c +++ b/dix/enterleave.c @@ -1074,13 +1074,13 @@ CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, if (!noPanoramiXExtension) nscreens = 1; #endif for (i = 0; i < nscreens; i++) { - root = WindowTable[i]; + root = screenInfo.screens[i]->root; if (!HasOtherPointer(root, GetPairedDevice(dev)) && !FirstFocusChild(root)) { /* If pointer was on PointerRootWin and changes to NoneWin, and * the pointer paired with dev is below the current root window, * do a NotifyPointer run. */ if (dev->focus && dev->focus->win == PointerRootWin && @@ -1135,13 +1135,13 @@ CoreFocusToPointerRootOrNone(DeviceIntPtr dev, /* NullWindow means we include the root window */ CoreFocusOutEvents(dev, A, NullWindow, mode, NotifyNonlinearVirtual); for (i = 0; i < nscreens; i++) { - root = WindowTable[i]; + root = screenInfo.screens[i]->root; if (!HasFocus(root) && !FirstFocusChild(root)) { CoreFocusEvent(dev, FocusIn, mode, B ? NotifyPointerRoot : NotifyDetailNone, root); if (B == PointerRootWin) CoreFocusInNotifyPointerEvents(dev, root, None, mode, TRUE); } @@ -1166,13 +1166,13 @@ CoreFocusFromPointerRootOrNone(DeviceIntPtr dev, if (!noPanoramiXExtension) nscreens = 1; #endif for (i = 0; i < nscreens; i++) { - root = WindowTable[i]; + root = screenInfo.screens[i]->root; if (!HasFocus(root) && !FirstFocusChild(root)) { /* If pointer was on PointerRootWin and changes to NoneWin, and * the pointer paired with dev is below the current root window, * do a NotifyPointer run. */ if (dev->focus && dev->focus->win == PointerRootWin && @@ -1276,13 +1276,13 @@ DeviceFocusEvents(DeviceIntPtr dev, { if (from == PointerRootWin) DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode, NotifyPointer); /* Notify all the roots */ for (i = 0; i < nscreens; i++) - DeviceFocusEvent(dev, XI_FocusOut, mode, out, WindowTable[i]); + DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root); } else { if (IsParent(from, sprite->win)) DeviceFocusOutEvents(dev, sprite->win, from, mode, NotifyPointer); @@ -1290,25 +1290,25 @@ DeviceFocusEvents(DeviceIntPtr dev, /* next call catches the root too, if the screen changed */ DeviceFocusOutEvents(dev, from->parent, NullWindow, mode, NotifyNonlinearVirtual); } /* Notify all the roots */ for (i = 0; i < nscreens; i++) - DeviceFocusEvent(dev, XI_FocusIn, mode, in, WindowTable[i]); + DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root); if (to == PointerRootWin) DeviceFocusInEvents(dev, RootWindow(dev), sprite->win, mode, NotifyPointer); } else { if ((from == NullWindow) || (from == PointerRootWin)) { if (from == PointerRootWin) DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode, NotifyPointer); for (i = 0; i < nscreens; i++) - DeviceFocusEvent(dev, XI_FocusOut, mode, out, WindowTable[i]); + DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root); if (to->parent != NullWindow) DeviceFocusInEvents(dev, RootWindow(dev), to, mode, NotifyNonlinearVirtual); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to); if (IsParent(to, sprite->win)) DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer); } diff --git a/dix/events.c b/dix/events.c index 9e05dc96c..01865969b 100644 --- a/dix/events.c +++ b/dix/events.c @@ -553,15 +553,16 @@ XineramaConstrainCursor(DeviceIntPtr pDev) static Bool XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) { SpritePtr pSprite = pDev->spriteInfo->sprite; - if(pWin == WindowTable[0]) { - memcpy(pSprite->windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); + if(pWin == screenInfo.screens[0]->root) { + int i; + for (i = 0; i < PanoramiXNumScreens; i++) + pSprite->windows[i] = screenInfo.screens[i]->root; } else { PanoramiXRes *win; int rc, i; rc = dixLookupResourceByType((pointer *)&win, pWin->drawable.id, XRT_WINDOW, serverClient, DixReadAccess); @@ -616,13 +617,13 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, if(REGION_NUM_RECTS(&pSprite->Reg1) > 1) pSprite->hotShape = &pSprite->Reg1; else pSprite->hotShape = NullRegion; pSprite->confined = FALSE; - pSprite->confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin; + pSprite->confineWin = (pWin == screenInfo.screens[0]->root) ? NullWindow : pWin; CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL); } #endif /* PANORAMIX */ @@ -872,13 +873,13 @@ CheckVirtualMotion( ev->root_y = pSprite->hot.y; } } #ifdef PANORAMIX if (noPanoramiXExtension) /* No typo. Only set the root win if disabled */ #endif - RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum]; + RootWindow(pDev) = pSprite->hot.pScreen->root; } static void ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bool confineToScreen) { ScreenPtr pScreen = pWin->drawable.pScreen; @@ -1120,13 +1121,13 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) * GetCurrentRootWindow()->drawable.id doesn't give you the right * answer on the first motion event after a screen change because * the data that GetCurrentRootWindow relies on hasn't been * updated yet. */ if (ev->any.type == ET_Motion) - ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id; + ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id; eventinfo.event = ev; eventinfo.device = device; CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); } @@ -1336,13 +1337,13 @@ playmore: dev->spriteInfo->sprite->hotPhys.x = dev->spriteInfo->sprite->hotPhys.y = 0; ConfineCursorToWindow(dev, grab->confineTo, TRUE, TRUE); } else ConfineCursorToWindow(dev, - WindowTable[dev->spriteInfo->sprite->hotPhys.pScreen->myNum], + dev->spriteInfo->sprite->hotPhys.pScreen->root, TRUE, FALSE); PostNewCursor(dev); } } } @@ -1366,13 +1367,13 @@ ScreenRestructured (ScreenPtr pScreen) != pDev->spriteInfo->sprite->hotPhys.pScreen) pDev->spriteInfo->sprite->hotPhys.x = pDev->spriteInfo->sprite->hotPhys.y = 0; ConfineCursorToWindow(pDev, grab->confineTo, TRUE, TRUE); } else ConfineCursorToWindow(pDev, - WindowTable[pDev->spriteInfo->sprite->hotPhys.pScreen->myNum], + pDev->spriteInfo->sprite->hotPhys.pScreen->root, TRUE, FALSE); } } #endif static void @@ -2763,13 +2764,13 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) } else #endif { if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen) { pSprite->hot.pScreen = pSprite->hotPhys.pScreen; - RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum]; + RootWindow(pDev) = pSprite->hot.pScreen->root; } } pSprite->hot.x = ev->root_x; pSprite->hot.y = ev->root_y; if (pSprite->hot.x < pSprite->physLimits.x1) @@ -2846,13 +2847,13 @@ WindowsRestructured(void) pDev = pDev->next; } } #ifdef PANORAMIX /* This was added to support reconfiguration under Xdmx. The problem is - * that if the 0th screen (i.e., WindowTable[0]) is moved to an origin + * that if the 0th screen (i.e., screenInfo.screens[0]) is moved to an origin * other than 0,0, the information in the private sprite structure must * be updated accordingly, or XYToWindow (and other routines) will not * compute correctly. */ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) { GrabPtr grab; @@ -2889,13 +2890,13 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) != pSprite->hotPhys.pScreen) pSprite->hotPhys.x = pSprite->hotPhys.y = 0; ConfineCursorToWindow(pDev, grab->confineTo, TRUE, TRUE); } else ConfineCursorToWindow( pDev, - WindowTable[pSprite->hotPhys.pScreen->myNum], + pSprite->hotPhys.pScreen->root, TRUE, FALSE); } pDev = pDev->next; } } @@ -3048,13 +3049,13 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) if (!pDev->spriteInfo->sprite) return; pSprite = pDev->spriteInfo->sprite; - win = WindowTable[pScreen->myNum]; + win = pScreen->root; pSprite->hotPhys.pScreen = pScreen; pSprite->hot = pSprite->hotPhys; pSprite->hotLimits.x2 = pScreen->width; pSprite->hotLimits.y2 = pScreen->height; pSprite->win = win; @@ -3121,13 +3122,13 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) pSprite->screen = newScreen; /* Make sure we tell the DDX to update its copy of the screen */ if(pSprite->confineWin) XineramaConfineCursorToWindow(pDev, pSprite->confineWin, TRUE); else - XineramaConfineCursorToWindow(pDev, WindowTable[0], TRUE); + XineramaConfineCursorToWindow(pDev, screenInfo.screens[0]->root, TRUE); /* if the pointer wasn't confined, the DDX won't get told of the pointer warp so we reposition it here */ if(!syncEvents.playingEvents) (*pSprite->screen->SetCursorPosition)( pDev, pSprite->screen, @@ -3136,14 +3137,13 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) pSprite->hotPhys.y + panoramiXdataPtr[0].y - panoramiXdataPtr[pSprite->screen->myNum].y, FALSE); } } else #endif if (newScreen != pSprite->hotPhys.pScreen) - ConfineCursorToWindow(pDev, WindowTable[newScreen->myNum], - TRUE, FALSE); + ConfineCursorToWindow(pDev, newScreen->root, TRUE, FALSE); } #ifdef PANORAMIX static Bool XineramaPointInWindowIsVisible( @@ -3212,13 +3212,13 @@ XineramaWarpPointer(ClientPtr client) rc = dixLookupWindow(&source, winID, client, DixReadAccess); if (rc != Success) return rc; winX = source->drawable.x; winY = source->drawable.y; - if(source == WindowTable[0]) { + if(source == screenInfo.screens[0]->root) { winX -= panoramiXdataPtr[0].x; winY -= panoramiXdataPtr[0].y; } if (x < winX + stuff->srcX || y < winY + stuff->srcY || (stuff->srcWidth != 0 && @@ -3228,13 +3228,13 @@ XineramaWarpPointer(ClientPtr client) !XineramaPointInWindowIsVisible(source, x, y)) return Success; } if (dest) { x = dest->drawable.x; y = dest->drawable.y; - if(dest == WindowTable[0]) { + if(dest == screenInfo.screens[0]->root) { x -= panoramiXdataPtr[0].x; y -= panoramiXdataPtr[0].y; } } x += stuff->dstX; diff --git a/dix/globals.c b/dix/globals.c index c24a94fbe..28e7d072d 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -80,14 +80,12 @@ PtrCtrl defaultPointerControl = { ClientPtr clients[MAXCLIENTS]; ClientPtr serverClient; int currentMaxClients; /* current size of clients array */ long maxBigRequestSize = MAX_BIG_REQUEST_SIZE; -WindowPtr WindowTable[MAXSCREENS]; - unsigned long globalSerialNumber = 0; unsigned long serverGeneration = 0; /* these next four are initialized in main.c */ CARD32 ScreenSaverTime; CARD32 ScreenSaverInterval; diff --git a/dix/main.c b/dix/main.c index 3e500ba4d..982fedd6b 100644 --- a/dix/main.c +++ b/dix/main.c @@ -246,13 +246,13 @@ int main(int argc, char *argv[], char *envp[]) */ if (!noPanoramiXExtension) PanoramiXConsolidate(); #endif for (i = 0; i < screenInfo.numScreens; i++) - InitRootWindow(WindowTable[i]); + InitRootWindow(screenInfo.screens[i]->root); InitCoreDevices(); InitInput(argc, argv); InitAndStartDevices(); dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); @@ -300,13 +300,14 @@ int main(int argc, char *argv[], char *envp[]) #else FreeAllResources(); #endif CloseInput(); - memset(WindowTable, 0, sizeof(WindowTable)); + for (i = 0; i < screenInfo.numScreens; i++) + screenInfo.screens[i]->root = NullWindow; CloseDownDevices(); CloseDownEvents(); for (i = screenInfo.numScreens - 1; i >= 0; i--) { FreeScratchPixmapsForScreen(i); diff --git a/dix/window.c b/dix/window.c index bdad749e8..71edd4681 100644 --- a/dix/window.c +++ b/dix/window.c @@ -207,13 +207,13 @@ PrintWindowTree(void) int i; WindowPtr pWin, p1; for (i=0; i<screenInfo.numScreens; i++) { ErrorF("[dix] WINDOW %d\n", i); - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; miPrintRegion(&pWin->clipList); p1 = pWin->firstChild; PrintChildren(p1, 4); } } #endif @@ -253,13 +253,13 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) * exit WalkTree. Does depth-first traverse. *****/ int WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) { - return(TraverseTree(WindowTable[pScreen->myNum], func, data)); + return(TraverseTree(pScreen->root, func, data)); } /* hack for forcing backing store on all windows */ int defaultBackingStore = NotUseful; /* hack to force no backing store */ Bool disableBackingStore = FALSE; @@ -363,13 +363,13 @@ CreateRootWindow(ScreenPtr pScreen) pScreen->screensaver.pWindow = NULL; pScreen->screensaver.wid = FakeClientID(0); pScreen->screensaver.ExternalScreenSaver = NULL; screenIsSaved = SCREEN_SAVER_OFF; - WindowTable[pScreen->myNum] = pWin; + pScreen->root = pWin; pWin->drawable.pScreen = pScreen; pWin->drawable.type = DRAWABLE_WINDOW; pWin->devPrivates = NULL; pWin->drawable.depth = pScreen->rootDepth; @@ -1324,13 +1324,13 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) pVlist++; /* * install the new */ if ( cursorID == None) { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) + if (pWin == pWin->drawable.pScreen->root) pCursor = rootCursor; else pCursor = (CursorPtr) None; } else { @@ -2961,13 +2961,13 @@ HandleSaveSet(ClientPtr client) for (j=0; j<client->numSaved; j++) { pWin = SaveSetWindow(client->saveSet[j]); #ifdef XFIXES if (SaveSetToRoot(client->saveSet[j])) - pParent = WindowTable[pWin->drawable.pScreen->myNum]; + pParent = pWin->drawable.pScreen->root; else #endif { pParent = pWin->parent; while (pParent && (wClient (pParent) == client)) pParent = pParent->parent; @@ -3247,13 +3247,12 @@ SaveScreens(int on, int mode) return dixSaveScreens(serverClient, on, mode); } static Bool TileScreenSaver(ScreenPtr pScreen, int kind) { - int i = pScreen->myNum; int j; int result; XID attributes[3]; Mask mask; WindowPtr pWin; CursorMetricRec cm; @@ -3263,27 +3262,27 @@ TileScreenSaver(ScreenPtr pScreen, int kind) int attri; mask = 0; attri = 0; switch (kind) { case SCREEN_IS_TILED: - switch (WindowTable[i]->backgroundState) { + switch (pScreen->root->backgroundState) { case BackgroundPixel: - attributes[attri++] = WindowTable[i]->background.pixel; + attributes[attri++] = pScreen->root->background.pixel; mask |= CWBackPixel; break; case BackgroundPixmap: attributes[attri++] = None; mask |= CWBackPixmap; break; default: break; } break; case SCREEN_IS_BLACK: - attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel; + attributes[attri++] = pScreen->root->drawable.pScreen->blackPixel; mask |= CWBackPixel; break; } mask |= CWOverrideRedirect; attributes[attri++] = xTrue; @@ -3326,18 +3325,18 @@ TileScreenSaver(ScreenPtr pScreen, int kind) free(mskbits); } } pWin = pScreen->screensaver.pWindow = CreateWindow(pScreen->screensaver.wid, - WindowTable[i], + pScreen->root, -RANDOM_WIDTH, -RANDOM_WIDTH, (unsigned short)pScreen->width + RANDOM_WIDTH, (unsigned short)pScreen->height + RANDOM_WIDTH, 0, InputOutput, mask, attributes, 0, serverClient, - wVisual (WindowTable[i]), &result); + wVisual (pScreen->root), &result); if (cursor) FreeResource (cursorID, RT_NONE); if (!pWin) return FALSE; @@ -737,13 +737,13 @@ typedef struct { * XFree86 empties the root BorderClip when the VT is inactive, * here's a macro which uses that to disable GetImage and GetSpans */ #define fbWindowEnabled(pWin) \ REGION_NOTEMPTY((pWin)->drawable.pScreen, \ - &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip) + &(pWin)->drawable.pScreen->root->borderClip) #define fbDrawableEnabled(pDrawable) \ ((pDrawable)->type == DRAWABLE_PIXMAP ? \ TRUE : fbWindowEnabled((WindowPtr) pDrawable)) #define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0) 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 @@ -294,13 +294,13 @@ void dmxFlushPendingSyncs(void) /** Update DMX's screen resources to match those of the newly moved * and/or resized "root" window. */ 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; /* Handle special case where width and/or height are zero */ if (w == 0 || h == 0) { w = 1; @@ -399,13 +399,13 @@ static void dmxConfigureScreenWindow(int idx, /** Change the "root" window position and size by resizing the actual * window on the back-end display (if necessary) and updating all of * DMX's resources by calling #dmxUpdateScreenResources. */ 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 * this one calls handle that case. */ /* 1. Resize "root" window */ @@ -434,13 +434,13 @@ static void dmxConfigureRootWindow(int idx, int x, int y, int w, int h) * structures (dix and Xinerama) to use the new origin and adjust the * positions of windows that overlap this "root" window. */ 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; /* Change "root" window's origin */ dmxScreen->rootXOrigin = x; @@ -455,13 +455,13 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y) dixScreenOrigins[idx].y = dmxScreen->rootYOrigin; /* Recalculate the Xinerama regions and data structs */ 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 */ pScreen->MoveWindow(pChild, pChild->origin.x - wBorderWidth(pChild) - xoff, pChild->origin.y - wBorderWidth(pChild) - yoff, @@ -631,13 +631,13 @@ int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs) /* Handle shift[XY] changes */ if (attribs->shiftX || attribs->shiftY) { 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, pChild->origin.x - wBorderWidth(pChild) - attribs->shiftX, pChild->origin.y - wBorderWidth(pChild) @@ -911,13 +911,13 @@ static void dmxBECreateResources(pointer value, XID id, RESTYPE type, * itself to create each window's parents. This is required so that we * have the opportunity to create each window's border and background * pixmaps (where appropriate) before the window is created. */ 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; /* Create the pixmaps associated with the root window */ if (!pRoot->borderIsPixel) { dmxBECreatePixmap(pRoot->border.pixmap); @@ -979,13 +979,13 @@ static void dmxBECreateWindowTree(int idx) } /* Refresh screen by generating exposure events for all windows */ static void dmxForceExposures(int idx) { ScreenPtr pScreen = screenInfo.screens[idx]; - WindowPtr pRoot = WindowTable[idx]; + WindowPtr pRoot = pScreen->root; Bool anyMarked = FALSE; WindowPtr pChild; for (pChild = pRoot->firstChild; pChild; pChild = pChild->nextSib) anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild, (WindowPtr *)NULL); @@ -1507,13 +1507,13 @@ static void dmxBEDestroyScratchGCs(int scrnNum) * XDestroyWindow() calls succeed, they must be performed in a bottom * up order so that windows are not destroyed before their children. * XDestroyWindow(), which is called from #dmxBEDestroyWindow(), will * 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) { if (pChild->firstChild) { pChild = pChild->firstChild; continue; 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 @@ -201,13 +201,13 @@ static void dmxConsoleDrawWindows(pointer private) rect.y = 0; rect.width = priv->consWidth; rect.height = priv->consHeight; 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 dmxLog(dmxDebug, "%lu %p %p %p 2\n", pRoot->drawable.id, pRoot->parent, pRoot->firstChild, pRoot->lastChild); 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 @@ -567,13 +567,13 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput, DMXUpdateType type, WindowPtr pWindow) { 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 { const char *name = "Unknown"; switch (type) { 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 @@ -92,13 +92,13 @@ static Bool kdCaughtSignal = FALSE; KdOsFuncs *kdOsFuncs; void KdSetRootClip (ScreenPtr pScreen, BOOL enable) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; WindowPtr pChild; Bool WasViewable; Bool anyMarked = FALSE; WindowPtr pLayerWin; BoxRec box; 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 @@ -1059,13 +1059,13 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen) * all of the windows */ 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; WindowPtr pLayerWin; BoxRec box; 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 @@ -156,13 +156,13 @@ xf86RandRSetMode (ScreenPtr pScreen, int oldWidth = pScreen->width; int oldHeight = pScreen->height; int oldmmWidth = pScreen->mmWidth; 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) (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); if (useVirtual) { 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 @@ -1878,13 +1878,13 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) free(rects); } 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); xRectangle *rects; GCPtr gc; 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 @@ -344,13 +344,13 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced) { if (!(pEv->mask & mask)) continue; 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 @@ -1184,13 +1184,13 @@ DRIDriverClipNotify(ScreenPtr pScreen) if (pDRIPriv->pDriverInfo->ClipNotify) { WindowPtr *pDRIWindows = calloc(sizeof(WindowPtr), pDRIPriv->nrWindows); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; if (pDRIPriv->nrWindows > 0) { pDRIPriv->nrWalked = 0; - TraverseTree(WindowTable[pScreen->myNum], DRIDCNTreeTraversal, + TraverseTree(pScreen->root, DRIDCNTreeTraversal, (pointer)pDRIWindows); } pDRIInfo->ClipNotify(pScreen, pDRIWindows, pDRIPriv->nrWindows); free(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 @@ -604,13 +604,13 @@ DRI2CanFlip(DrawablePtr pDraw) WindowPtr pWin, pRoot; PixmapPtr pWinPixmap, pRootPixmap; if (pDraw->type == DRAWABLE_PIXMAP) return TRUE; - pRoot = WindowTable[pScreen->myNum]; + pRoot = pScreen->root; pRootPixmap = pScreen->GetWindowPixmap(pRoot); pWin = (WindowPtr) pDraw; pWinPixmap = pScreen->GetWindowPixmap(pWin); if (pRootPixmap != pWinPixmap) return FALSE; 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 @@ -514,13 +514,13 @@ xf86RandR12SetMode (ScreenPtr pScreen, ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; 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; if (pRoot) (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); @@ -682,13 +682,13 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, CARD32 mmWidth, CARD32 mmHeight) { 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; #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) if (xf86RandR12Key) { @@ -736,13 +736,13 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, xf86SetViewport (pScreen, 0, 0); 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; } Rotation 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 @@ -73,15 +73,15 @@ compWindowFormat (WindowPtr pWin) static void 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); BoxPtr b = REGION_RECTS(region); XID include_inferiors = IncludeInferiors; 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 @@ -44,13 +44,13 @@ XAACopyWindow( } (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow); return; } - pwinRoot = WindowTable[pScreen->myNum]; + pwinRoot = pScreen->root; REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); 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 @@ -51,13 +51,13 @@ XAACopyWindow8_32( } (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow8_32); return; } - pwinRoot = WindowTable[pScreen->myNum]; + pwinRoot = pScreen->root; if(doUnderlay) freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip); REGION_NULL(pScreen, &rgnDst); 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 @@ -321,13 +321,13 @@ XAAOverCopyWindow( XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen); ScrnInfoPtr pScrn = infoRec->pScrn; DDXPointPtr ppt, pptSrc; RegionRec rgnDst; BoxPtr pbox; int i, nbox, dx, dy; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) { XAA_SCREEN_PROLOGUE (pScreen, CopyWindow); if(pScrn->vtSema && infoRec->NeedToSync) { (*infoRec->Sync)(pScrn); 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 @@ -790,13 +790,13 @@ void AbortDDX( void ) * all of the windows */ 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; RegionPtr pOldClip = NULL, bsExposed; WindowPtr pLayerWin; BoxRec box; 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 @@ -273,13 +273,13 @@ void QuartzUpdateScreens(void) { * so use it rather than x/y */ sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; 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); /* <rdar://problem/7770779> pointer events are clipped to old display region after display reconfiguration * http://xquartz.macosforge.org/trac/ticket/346 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 @@ -573,13 +573,13 @@ xprHideWindows(Bool hide) WindowPtr pRoot, pWin; TA_SERVER(); 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); if (winRec != NULL) { if (hide) { 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 @@ -394,13 +394,13 @@ xprSetupScreen(int index, ScreenPtr pScreen) static void xprUpdateScreen(ScreenPtr pScreen) { rootlessGlobalOffsetX = darwinMainScreenX; rootlessGlobalOffsetY = darwinMainScreenY; - AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]); + AppleWMSetScreenOrigin(pScreen->root); RootlessRepositionWindows(pScreen); RootlessUpdateScreenPixmap(pScreen); } /* @@ -413,13 +413,13 @@ xprInitInput(int argc, char **argv) int i; rootlessGlobalOffsetX = darwinMainScreenX; rootlessGlobalOffsetY = darwinMainScreenY; for (i = 0; i < screenInfo.numScreens; i++) - AppleWMSetScreenOrigin(WindowTable[i]); + AppleWMSetScreenOrigin(screenInfo.screens[i]->root); } /* * Quartz display mode function list. */ static QuartzModeProcsRec xprModeProcs = { 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 @@ -259,13 +259,13 @@ winRestoreModeKeyStates (void) /* X server is being initialized */ if (!inputInfo.keyboard) return; /* 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 */ if (processEvents) mieqProcessInputEvents (); 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 @@ -404,13 +404,13 @@ winIsInternalWMRunning (winScreenInfoPtr pScreenInfo) */ void winMWExtWMRestackWindows (ScreenPtr pScreen) { winScreenPriv(pScreen); - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; WindowPtr pWin = NULL; WindowPtr pWinPrev = NULL; win32RootlessWindowPtr pRLWin = NULL; win32RootlessWindowPtr pRLWinPrev = NULL; int nWindow = 0; HDWP hWinPosInfo = 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 @@ -141,13 +141,13 @@ winCopyWindowNativeGDI (WindowPtr pWin, #if 0 ErrorF ("winCopyWindow\n"); #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); /* Calculate the shift from the source to the destination */ dx = ptOldOrg.x - pWin->drawable.x; diff --git a/include/globals.h b/include/globals.h index 6959fc71a..7de262fe3 100644 --- a/include/globals.h +++ b/include/globals.h @@ -16,13 +16,12 @@ extern _X_EXPORT Bool screenSaverSuspended; #endif extern _X_EXPORT char *defaultFontPath; extern _X_EXPORT int monitorResolution; extern _X_EXPORT int defaultColorVisualClass; -extern _X_EXPORT WindowPtr WindowTable[MAXSCREENS]; extern _X_EXPORT int GrabInProgress; extern _X_EXPORT Bool noTestExtensions; extern _X_EXPORT DDXPointRec dixScreenOrigins[MAXSCREENS]; extern _X_EXPORT char *ConnectionInfo; diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 1460bc4c6..f8171ca5c 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -475,12 +475,13 @@ typedef struct _Screen { a standard one. */ PixmapPtr PixmapPerDepth[1]; pointer devPrivate; short numVisuals; VisualPtr visuals; + WindowPtr root; ScreenSaverStuffRec screensaver; /* Random screen procedures */ CloseScreenProcPtr CloseScreen; QueryBestSizeProcPtr QueryBestSize; diff --git a/mi/midispcur.c b/mi/midispcur.c index c279010e6..87eb27d4e 100644 --- a/mi/midispcur.c +++ b/mi/midispcur.c @@ -402,13 +402,13 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, pPriv = miDCRealize(pScreen, pCursor); if (!pPriv) return FALSE; } pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); - pWin = WindowTable[pScreen->myNum]; + pWin = pScreen->root; pBuffer = MIDCBUFFER(pDev, pScreen); #ifdef ARGB_CURSOR if (pPriv->pPicture) { if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin)) @@ -445,13 +445,13 @@ miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen, pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); pBuffer = MIDCBUFFER(pDev, pScreen); pSave = pBuffer->pSave; - pWin = WindowTable[pScreen->myNum]; + pWin = pScreen->root; if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) { if (pSave) (*pScreen->DestroyPixmap) (pSave); pBuffer->pSave = pSave = (*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0); @@ -479,13 +479,13 @@ miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen, pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); pBuffer = MIDCBUFFER(pDev, pScreen); pSave = pBuffer->pSave; - pWin = WindowTable[pScreen->myNum]; + pWin = pScreen->root; if (!pSave) return FALSE; pGC = pBuffer->pRestoreGC; if (pWin->drawable.serialNumber != pGC->serialNumber) ValidateGC ((DrawablePtr) pWin, pGC); @@ -510,13 +510,13 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) pBuffer = calloc(1, sizeof(miDCBufferRec)); if (!pBuffer) goto failure; dixSetPrivate(&pDev->devPrivates, miDCSpriteKey + pScreen->myNum, pBuffer); - pWin = WindowTable[pScreen->myNum]; + pWin = pScreen->root; pBuffer->pSourceGC = miDCMakeGC(pWin); if (!pBuffer->pSourceGC) goto failure; pBuffer->pMaskGC = miDCMakeGC(pWin); diff --git a/mi/miexpose.c b/mi/miexpose.c index 57968dd2a..9249ca9f9 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -423,13 +423,13 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy) int x = 0, y = 0; XID realWin = 0; if(!pWin->parent) { x = panoramiXdataPtr[scrnum].x; y = panoramiXdataPtr[scrnum].y; - pWin = WindowTable[0]; + pWin = screenInfo.screens[0]->root; realWin = pWin->drawable.id; } else if (scrnum) { PanoramiXRes *win; win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, scrnum); if(!win) { diff --git a/mi/mioverlay.c b/mi/mioverlay.c index 1a3ac4185..da3ff4ae7 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -303,13 +303,13 @@ miOverlayRealizeWindow(WindowPtr pWin) static void miOverlayReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) { if(IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)) { /* This could probably be more optimal */ - RebuildTree(WindowTable[pWin->drawable.pScreen->myNum]->firstChild); + RebuildTree(pWin->drawable.pScreen->root->firstChild); } } static void miOverlayRestackWindow(WindowPtr pWin, WindowPtr oldNextSib) { @@ -1607,13 +1607,13 @@ miOverlayChangeBorderWidth( /* We need this as an addition since the xf86 common code doesn't know about the second tree which is static to this file. */ void miOverlaySetRootClip(ScreenPtr pScreen, Bool enable) { - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pRoot); MARK_UNDERLAY(pRoot); if(enable) { BoxRec box; 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 @@ -444,13 +444,13 @@ RootlessRedisplay(WindowPtr pWindow) * RootlessRepositionWindows * Reposition all windows on a screen to their correct positions. */ void RootlessRepositionWindows(ScreenPtr pScreen) { - WindowPtr root = WindowTable[pScreen->myNum]; + WindowPtr root = pScreen->root; WindowPtr win; if (root != NULL) { RootlessRepositionWindow(root); for (win = root->firstChild; win; win = win->nextSib) { @@ -465,13 +465,13 @@ RootlessRepositionWindows(ScreenPtr pScreen) * RootlessRedisplayScreen * Walk every window on a screen and redisplay the damaged regions. */ void RootlessRedisplayScreen(ScreenPtr pScreen) { - WindowPtr root = WindowTable[pScreen->myNum]; + WindowPtr root = pScreen->root; if (root != NULL) { WindowPtr win; RootlessRedisplay(root); for (win = root->firstChild; win; win = win->nextSib) { 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 @@ -210,13 +210,13 @@ extern RegionRec rootlessHugeRoot; // The root is not a top-level window. #define IsTopLevel(pWin) \ ((pWin) && (pWin)->parent && !(pWin)->parent->parent) // Returns TRUE if this window is a root window #define IsRoot(pWin) \ - ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum]) + ((pWin) == (pWin)->drawable.pScreen->root) /* * SetPixmapBaseToScreen * Move the given pixmap's base address to where pixel (0, 0) * would be if the pixmap's actual data started at (x, y). 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 @@ -490,13 +490,13 @@ static void expose_1 (WindowPtr pWin) { expose_1 (pChild); } void RootlessScreenExpose (ScreenPtr pScreen) { - expose_1 (WindowTable[pScreen->myNum]); + expose_1 (pScreen->root); } ColormapPtr RootlessGetColormap (ScreenPtr pScreen) { 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 @@ -1514,13 +1514,13 @@ RootlessOrderAllWindows (void) if (windows_hidden) return; 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) { if (!pWin->realized) continue; if (RootlessEnsureFrame(pWin) == NULL) continue; RootlessReorderWindow (pWin); @@ -1530,26 +1530,26 @@ RootlessOrderAllWindows (void) } void RootlessEnableRoot (ScreenPtr pScreen) { WindowPtr pRoot; - pRoot = WindowTable[pScreen->myNum]; + pRoot = pScreen->root; RootlessEnsureFrame (pRoot); (*pScreen->ClearToBackground) (pRoot, 0, 0, 0, 0, TRUE); RootlessReorderWindow (pRoot); } void RootlessDisableRoot (ScreenPtr pScreen) { WindowPtr pRoot; RootlessWindowRec *winRec; - pRoot = WindowTable[pScreen->myNum]; + pRoot = pScreen->root; winRec = WINREC (pRoot); if (NULL == winRec) return; RootlessDestroyFrame (pRoot, winRec); @@ -1569,14 +1569,16 @@ RootlessHideAllWindows (void) windows_hidden = TRUE; 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) { if (!pWin->realized) continue; @@ -1606,14 +1608,16 @@ RootlessShowAllWindows (void) windows_hidden = FALSE; 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) { if (!pWin->realized) continue; diff --git a/randr/rrscreen.c b/randr/rrscreen.c index a940f8aae..a2a0f36a6 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -70,13 +70,13 @@ RREditConnectionInfo (ScreenPtr pScreen) root->mmHeight = pScreen->mmHeight; } void RRSendConfigNotify (ScreenPtr pScreen) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; xEvent event; event.u.u.type = ConfigureNotify; event.u.configureNotify.window = pWin->drawable.id; event.u.configureNotify.aboveSibling = None; event.u.configureNotify.x = 0; @@ -94,13 +94,13 @@ RRSendConfigNotify (ScreenPtr pScreen) void RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) { rrScrPriv (pScreen); xRRScreenChangeNotifyEvent se; RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; se.type = RRScreenChangeNotify + RREventBase; se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); se.timestamp = pScrPriv->lastSetTime.milliseconds; se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; se.root = pRoot->drawable.id; @@ -617,13 +617,13 @@ ProcRRGetScreenInfo (ClientPtr client) if (!pScrPriv || !output) { rep.type = X_Reply; rep.setOfRotations = RR_Rotate_0; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + rep.root = pWin->drawable.pScreen->root->drawable.id; rep.timestamp = currentTime.milliseconds; rep.configTimestamp = currentTime.milliseconds; rep.nSizes = 0; rep.sizeID = 0; rep.rotation = RR_Rotate_0; rep.rate = 0; @@ -646,13 +646,13 @@ ProcRRGetScreenInfo (ClientPtr client) return BadAlloc; rep.type = X_Reply; rep.setOfRotations = output->crtc->rotations; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + rep.root = pWin->drawable.pScreen->root->drawable.id; rep.timestamp = pScrPriv->lastSetTime.milliseconds; rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; rep.rotation = output->crtc->rotation; rep.nSizes = pData->nsize; rep.nrateEnts = pData->nrefresh + pData->nsize; rep.sizeID = pData->size; @@ -958,13 +958,13 @@ sendReply: /* rep.status has already been filled in */ rep.length = 0; rep.sequenceNumber = client->sequence; rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; + rep.root = pDraw->pScreen->root->drawable.id; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); swapl(&rep.newTimestamp, n); diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 457b2b40f..c1bd5bb33 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -213,13 +213,13 @@ ProcRRXineramaGetScreenSize(ClientPtr client) REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; pScreen = pWin->drawable.pScreen; - pRoot = WindowTable[pScreen->myNum]; + pRoot = pScreen->root; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.width = pRoot->drawable.width; rep.height = pRoot->drawable.height; diff --git a/render/render.c b/render/render.c index b58dd3ebe..d34250227 100644 --- a/render/render.c +++ b/render/render.c @@ -2678,13 +2678,13 @@ PanoramiXRenderCreatePicture (ClientPtr client) if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; newPict->info[0].id = stuff->pid; if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) + stuff->drawable == screenInfo.screens[0]->root->drawable.id) { newPict->u.pict.root = TRUE; } else newPict->u.pict.root = FALSE; diff --git a/xfixes/cursor.c b/xfixes/cursor.c index d3a207ddb..5f08db7a5 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -687,13 +687,13 @@ ReplaceCursor (CursorPtr pCursor, rcl.type, ReplaceCursorLookup, (pointer) &rcl); } } /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ - WindowHasNewCursor (WindowTable[0]); + WindowHasNewCursor (screenInfo.screens[0]->root); } static Bool TestForCursor (CursorPtr pCursor, pointer closure) { return (pCursor == (CursorPtr) closure); diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 93175c538..0f3ffa468 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -40,12 +40,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <X11/keysym.h> #include <X11/Xatom.h> #include "misc.h" #include "inputstr.h" #include "opaque.h" #include "property.h" +#include "scrnintstr.h" #define XKBSRV_NEED_FILE_FUNCS #include <xkbsrv.h> #include "xkbgeom.h" #include <X11/extensions/XKMformat.h> #include "xkbfile.h" #include "xkb.h" @@ -207,13 +208,13 @@ char * pval; } pval[out++]= '\0'; if (out!=len) { ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n", out,len); } - dixChangeWindowProperty(serverClient, WindowTable[0], name, XA_STRING, 8, + dixChangeWindowProperty(serverClient, screenInfo.screens[0]->root, name, XA_STRING, 8, PropModeReplace, len, pval, TRUE); free(pval); return TRUE; } static void |