diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 32a96d08ce..0a2bdeafb8 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -35,6 +35,7 @@ Equipment Corporation. #include "dix/resource_priv.h" #include "dix/rpcbuf_priv.h" #include "dix/screen_hooks_priv.h" +#include "dix/screenint_priv.h" #include "miext/extinit_priv.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" @@ -395,9 +396,10 @@ XineramaInitData(void) RegionUninit(&ScreenRegion); }); - PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width; - PanoramiXPixHeight = - screenInfo.screens[0]->y + screenInfo.screens[0]->height; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + PanoramiXPixWidth = firstScreen->x + firstScreen->width; + PanoramiXPixHeight = firstScreen->y + firstScreen->height; XINERAMA_FOR_EACH_SCREEN_FORWARD_SKIP0({ int w = walkScreen->x + walkScreen->width; @@ -423,7 +425,7 @@ PanoramiXExtensionInit(void) int i; Bool success = FALSE; ExtensionEntry *extEntry; - ScreenPtr pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); if (noPanoramiXExtension) return; @@ -589,14 +591,16 @@ PanoramiXCreateConnectionBlock(void) return FALSE; } + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + for (unsigned int walkScreenIdx = 1; walkScreenIdx < screenInfo.numScreens; walkScreenIdx++) { ScreenPtr walkScreen = screenInfo.screens[walkScreenIdx]; - if (walkScreen->rootDepth != screenInfo.screens[0]->rootDepth) { + if (walkScreen->rootDepth != firstScreen->rootDepth) { ErrorF("Xinerama error: Root window depths differ\n"); return FALSE; } if (walkScreen->backingStoreSupport != - screenInfo.screens[0]->backingStoreSupport) + firstScreen->backingStoreSupport) disable_backing_store = TRUE; } @@ -775,7 +779,7 @@ extern void PanoramiXConsolidate(void) { int i; - ScreenPtr pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); DepthPtr pDepth = pScreen->allowedDepths; VisualPtr pVisual = pScreen->visuals; @@ -1236,8 +1240,9 @@ XineramaGetImageData(DrawablePtr *pDrawables, SrcBox.x1 = left; SrcBox.y1 = top; if (!isRoot) { - SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x; - SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + SrcBox.x1 += pDraw->x + firstScreen->x; + SrcBox.y1 += pDraw->y + firstScreen->y; } SrcBox.x2 = SrcBox.x1 + width; SrcBox.y2 = SrcBox.y1 + height; diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index b840c87dba..261551ea14 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -33,6 +33,7 @@ Equipment Corporation. #include "dix/dix_priv.h" #include "dix/rpcbuf_priv.h" +#include "dix/screenint_priv.h" #include "os/osdep.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" @@ -66,7 +67,6 @@ PanoramiXCreateWindow(ClientPtr client) int result, len; int orig_x, orig_y; XID orig_visual, tmp; - Bool parentIsRoot; REQUEST_AT_LEAST_SIZE(xCreateWindowReq); @@ -131,8 +131,11 @@ PanoramiXCreateWindow(ClientPtr client) orig_visual = stuff->visual; orig_x = stuff->x; orig_y = stuff->y; - parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) - || (stuff->parent == screenInfo.screens[0]->screensaver.wid); + + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + Bool parentIsRoot = (stuff->parent == firstScreen->root->drawable.id) + || (stuff->parent == firstScreen->screensaver.wid); XINERAMA_FOR_EACH_SCREEN_BACKWARD({ stuff->wid = newWin->info[walkScreenIdx].id; @@ -323,7 +326,6 @@ PanoramiXReparentWindow(ClientPtr client) PanoramiXRes *win, *parent; int result; int x, y; - Bool parentIsRoot; REQUEST(xReparentWindowReq); @@ -341,8 +343,11 @@ PanoramiXReparentWindow(ClientPtr client) x = stuff->x; y = stuff->y; - parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) - || (stuff->parent == screenInfo.screens[0]->screensaver.wid); + + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + Bool parentIsRoot = (stuff->parent == firstScreen->root->drawable.id) + || (stuff->parent == firstScreen->screensaver.wid); XINERAMA_FOR_EACH_SCREEN_BACKWARD({ stuff->window = win->info[walkScreenIdx].id; @@ -500,9 +505,10 @@ PanoramiXConfigureWindow(ClientPtr client) } } - if (pWin->parent && ((pWin->parent == screenInfo.screens[0]->root) || - (pWin->parent->drawable.id == - screenInfo.screens[0]->screensaver.wid))) { + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + if (pWin->parent && ((pWin->parent == firstScreen->root) || + (pWin->parent->drawable.id == firstScreen->screensaver.wid))) { if ((Mask) stuff->mask & CWX) { x_offset = 0; x = *((CARD32 *) &stuff[1]); @@ -569,8 +575,10 @@ PanoramiXGetGeometry(ClientPtr client) if (rc != Success) return rc; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + xGetGeometryReply reply = { - .root = screenInfo.screens[0]->root->drawable.id, + .root = firstScreen->root->drawable.id, .depth = pDraw->depth, .width = pDraw->width, .height = pDraw->height, @@ -591,11 +599,10 @@ PanoramiXGetGeometry(ClientPtr client) reply.x = pWin->origin.x - wBorderWidth(pWin); reply.y = pWin->origin.y - wBorderWidth(pWin); - if ((pWin->parent == screenInfo.screens[0]->root) || - (pWin->parent->drawable.id == - screenInfo.screens[0]->screensaver.wid)) { - reply.x += screenInfo.screens[0]->x; - reply.y += screenInfo.screens[0]->y; + if ((pWin->parent == firstScreen->root) || + (pWin->parent->drawable.id == firstScreen->screensaver.wid)) { + reply.x += firstScreen->x; + reply.y += firstScreen->y; } reply.borderWidth = pWin->borderWidth; } @@ -629,10 +636,12 @@ PanoramiXTranslateCoords(ClientPtr client) if (rc != Success) return rc; - if ((pWin == screenInfo.screens[0]->root) || - (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) { - x = stuff->srcX - screenInfo.screens[0]->x; - y = stuff->srcY - screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + if ((pWin == firstScreen->root) || + (pWin->drawable.id == firstScreen->screensaver.wid)) { + x = stuff->srcX - firstScreen->x; + y = stuff->srcY - firstScreen->y; } else { x = pWin->drawable.x + stuff->srcX; @@ -669,10 +678,10 @@ PanoramiXTranslateCoords(ClientPtr client) INT16 dstX = x - pDst->drawable.x; INT16 dstY = y - pDst->drawable.y; - if ((pDst == screenInfo.screens[0]->root) || - (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid)) { - dstX += screenInfo.screens[0]->x; - dstY += screenInfo.screens[0]->y; + if ((pDst == firstScreen->root) || + (pDst->drawable.id == firstScreen->screensaver.wid)) { + dstX += firstScreen->x; + dstY += firstScreen->y; } xTranslateCoordsReply reply = { @@ -1158,8 +1167,9 @@ PanoramiXCopyArea(ClientPtr client) dx = drawables[0]->x; dy = drawables[0]->y; if (srcIsRoot) { - dx += screenInfo.screens[0]->x; - dy += screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + dx += firstScreen->x; + dy += firstScreen->y; } sourceBox.x1 = min(srcx + dx, 0); @@ -2023,11 +2033,12 @@ PanoramiXGetImage(ClientPtr client) return BadMatch; } else { + ScreenPtr firstScreen = dixGetFirstScreenPtr(); /* check for being onscreen and inside of border */ - if (screenInfo.screens[0]->x + pDraw->x + x < 0 || - screenInfo.screens[0]->x + pDraw->x + x + w > PanoramiXPixWidth || - screenInfo.screens[0]->y + pDraw->y + y < 0 || - screenInfo.screens[0]->y + pDraw->y + y + h > PanoramiXPixHeight || + if (firstScreen->x + pDraw->x + x < 0 || + firstScreen->x + pDraw->x + x + w > PanoramiXPixWidth || + firstScreen->y + pDraw->y + y < 0 || + firstScreen->y + pDraw->y + y + h > PanoramiXPixHeight || x < -wBorderWidth((WindowPtr) pDraw) || x + w > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->width || y < -wBorderWidth((WindowPtr) pDraw) || diff --git a/Xext/shm.c b/Xext/shm.c index 4d08153b1a..87e7860e6c 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group. #include #include "dix/dix_priv.h" +#include "dix/screenint_priv.h" #include "dix/screen_hooks_priv.h" #include "miext/extinit_priv.h" #include "os/auth.h" @@ -812,12 +813,12 @@ ProcShmGetImage(ClientPtr client) return BadMatch; } else { + ScreenPtr firstScreen = dixGetFirstScreenPtr(); if ( /* check for being onscreen */ - screenInfo.screens[0]->x + pDraw->x + x < 0 || - screenInfo.screens[0]->x + pDraw->x + x + w > PanoramiXPixWidth - || screenInfo.screens[0]->y + pDraw->y + y < 0 || - screenInfo.screens[0]->y + pDraw->y + y + h > PanoramiXPixHeight - || + firstScreen->x + pDraw->x + x < 0 || + firstScreen->x + pDraw->x + x + w > PanoramiXPixWidth || + firstScreen->y + pDraw->y + y < 0 || + firstScreen->y + pDraw->y + y + h > PanoramiXPixHeight || /* check for being inside of border */ x < -wBorderWidth((WindowPtr) pDraw) || x + w > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->width || diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 46bf30e111..55be826f5b 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -32,6 +32,7 @@ SOFTWARE. #include "dix/dix_priv.h" #include "dix/rpcbuf_priv.h" +#include "dix/screenint_priv.h" #include "Xext/xvdix_priv.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" @@ -1543,7 +1544,7 @@ void XineramifyXv(void) { XvScreenPtr xvsp0 = - dixLookupPrivate(&screenInfo.screens[0]->devPrivates, XvGetScreenKey()); + dixLookupPrivate(&(dixGetFirstScreenPtr()->devPrivates), XvGetScreenKey()); XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; int i; diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 2ac260a9af..2620903d70 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -42,6 +42,7 @@ #include "dix/input_priv.h" #include "dix/inpututils_priv.h" #include "dix/rpcbuf_priv.h" +#include "dix/screenint_priv.h" #include "os/fmt.h" #include "Xext/panoramiXsrv.h" @@ -172,11 +173,12 @@ ProcXIQueryPointer(ClientPtr client) #ifdef XINERAMA if (!noPanoramiXExtension) { - rep.root_x += double_to_fp1616(screenInfo.screens[0]->x); - rep.root_y += double_to_fp1616(screenInfo.screens[0]->y); + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + rep.root_x += double_to_fp1616(firstScreen->x); + rep.root_y += double_to_fp1616(firstScreen->y); if (stuff->win == rep.root) { - rep.win_x += double_to_fp1616(screenInfo.screens[0]->x); - rep.win_y += double_to_fp1616(screenInfo.screens[0]->y); + rep.win_x += double_to_fp1616(firstScreen->x); + rep.win_y += double_to_fp1616(firstScreen->y); } } #endif /* XINERAMA */ diff --git a/composite/compext.c b/composite/compext.c index e0768bab85..05a74ce19f 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -44,6 +44,7 @@ #include #include "dix/dix_priv.h" +#include "dix/screenint_priv.h" #include "miext/extinit_priv.h" #include "Xext/panoramiXsrv.h" @@ -786,7 +787,7 @@ ProcCompositeGetOverlayWindow(ClientPtr client) return rc; } - cs = GetCompScreen(screenInfo.screens[0]); + cs = GetCompScreen(dixGetFirstScreenPtr()); if (!cs->pOverlayWin) { if (!(overlayWin = calloc(1, sizeof(PanoramiXRes)))) return BadAlloc; @@ -847,7 +848,7 @@ ProcCompositeGetOverlayWindow(ClientPtr client) AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin); } - cs = GetCompScreen(screenInfo.screens[0]); + cs = GetCompScreen(dixGetFirstScreenPtr()); rep = (xCompositeGetOverlayWindowReply) { .overlayWin = cs->pOverlayWin->drawable.id diff --git a/dix/devices.c b/dix/devices.c index c3f2a959f2..f4c0e23a35 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -61,6 +61,7 @@ SOFTWARE. #include "dix/input_priv.h" #include "dix/ptrveloc_priv.h" #include "dix/resource_priv.h" +#include "dix/screenint_priv.h" #include "mi/mi_priv.h" #include "os/bug_priv.h" #include "os/log_priv.h" @@ -378,9 +379,10 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) if (InputDevIsMaster(dev)) { /* Sprites appear on first root window, so we can hardcode it */ if (dev->spriteInfo->spriteOwner) { - InitializeSprite(dev, screenInfo.screens[0]->root); + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + InitializeSprite(dev, firstScreen->root); /* mode doesn't matter */ - EnterWindow(dev, screenInfo.screens[0]->root, NotifyAncestor); + EnterWindow(dev, firstScreen->root, NotifyAncestor); } else { other = NextFreePointerDevice(); @@ -589,7 +591,7 @@ int ActivateDevice(DeviceIntPtr dev, BOOL sendevent) { int ret = Success; - ScreenPtr pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); if (!dev || !dev->deviceProc) return BadImplementation; @@ -672,7 +674,7 @@ CorePointerProc(DeviceIntPtr pDev, int what) BYTE map[NBUTTONS + 1]; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; - ScreenPtr scr = screenInfo.screens[0]; + ScreenPtr scr = dixGetFirstScreenPtr(); switch (what) { case DEVICE_INIT: @@ -987,7 +989,7 @@ FreePendingFrozenDeviceEvents(DeviceIntPtr dev) static void CloseDevice(DeviceIntPtr dev) { - ScreenPtr screen = screenInfo.screens[0]; + ScreenPtr screen = dixGetFirstScreenPtr(); ClassesPtr classes; if (!dev) @@ -1142,7 +1144,7 @@ AbortDevices(void) void UndisplayDevices(void) { - ScreenPtr screen = screenInfo.screens[0]; + ScreenPtr screen = dixGetFirstScreenPtr(); for (DeviceIntPtr dev = inputInfo.devices; dev; dev = dev->next) screen->DisplayCursor(dev, screen, NullCursor); @@ -1184,7 +1186,7 @@ int RemoveDevice(DeviceIntPtr dev, BOOL sendevent) { int ret = BadMatch; - ScreenPtr screen = screenInfo.screens[0]; + ScreenPtr screen = dixGetFirstScreenPtr(); int deviceid; int initialized; int flags[MAXDEVICES] = { 0 }; @@ -2632,7 +2634,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) if (dev->spriteInfo->sprite) currentRoot = InputDevCurrentRootWindow(dev); else /* new device auto-set to floating */ - currentRoot = screenInfo.screens[0]->root; + currentRoot = dixGetFirstScreenPtr()->root; /* we need to init a fake sprite */ screen = currentRoot->drawable.pScreen; diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 1cfde12208..9d701ad743 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -60,6 +60,7 @@ Equipment Corporation. #include "dix/dix_priv.h" #include "dix/gc_priv.h" #include "dix/rpcbuf_priv.h" +#include "dix/screenint_priv.h" #include "include/swaprep.h" #include "os/auth.h" #include "os/log_priv.h" @@ -1868,7 +1869,7 @@ get_client_resolutions(int *num) static struct _FontResolution res; ScreenPtr pScreen; - pScreen = screenInfo.screens[0]; + pScreen = dixGetFirstScreenPtr(); res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; /* * XXX - we'll want this as long as bitmap instances are prevalent diff --git a/dix/events.c b/dix/events.c index bc6474443c..32dcd89c1e 100644 --- a/dix/events.c +++ b/dix/events.c @@ -128,6 +128,7 @@ Equipment Corporation. #include "dix/inpututils_priv.h" #include "dix/reqhandlers_priv.h" #include "dix/resource_priv.h" +#include "dix/screenint_priv.h" #include "dix/window_priv.h" #include "os/bug_priv.h" #include "os/client_priv.h" @@ -539,8 +540,10 @@ XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) that screen are. */ pScreen = pSprite->screen; - x += screenInfo.screens[0]->x; - y += screenInfo.screens[0]->y; + + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + x += firstScreen->x; + y += firstScreen->y; if (!point_on_screen(pScreen, x, y)) { XINERAMA_FOR_EACH_SCREEN_BACKWARD({ @@ -554,8 +557,8 @@ XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) } pSprite->screen = pScreen; - pSprite->hotPhys.x = x - screenInfo.screens[0]->x; - pSprite->hotPhys.y = y - screenInfo.screens[0]->y; + pSprite->hotPhys.x = x - firstScreen->x; + pSprite->hotPhys.y = y - firstScreen->y; x -= pScreen->x; y -= pScreen->y; @@ -571,12 +574,14 @@ XineramaConstrainCursor(DeviceIntPtr pDev) ScreenPtr pScreen = pSprite->screen; BoxRec newBox = pSprite->physLimits; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + /* Translate the constraining box to the screen the sprite is actually on */ - newBox.x1 += screenInfo.screens[0]->x - pScreen->x; - newBox.x2 += screenInfo.screens[0]->x - pScreen->x; - newBox.y1 += screenInfo.screens[0]->y - pScreen->y; - newBox.y2 += screenInfo.screens[0]->y - pScreen->y; + newBox.x1 += firstScreen->x - pScreen->x; + newBox.x2 += firstScreen->x - pScreen->x; + newBox.y1 += firstScreen->y - pScreen->y; + newBox.y2 += firstScreen->y - pScreen->y; (*pScreen->ConstrainCursor) (pDev, pScreen, &newBox); } @@ -586,7 +591,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) { SpritePtr pSprite = pDev->spriteInfo->sprite; - if (pWin == screenInfo.screens[0]->root) { + if (pWin == dixGetFirstScreenPtr()->root) { XINERAMA_FOR_EACH_SCREEN_BACKWARD({ pSprite->windows[walkScreenIdx] = walkScreen->root; }); @@ -655,7 +660,7 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, pSprite->confined = FALSE; pSprite->confineWin = - (pWin == screenInfo.screens[0]->root) ? NullWindow : pWin; + (pWin == dixGetFirstScreenPtr()->root) ? NullWindow : pWin; CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL); } @@ -1182,8 +1187,9 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) if (event->type == ET_Motion) { #ifdef XINERAMA if (!noPanoramiXExtension) { - event->root_x += pSprite->screen->x - screenInfo.screens[0]->x; - event->root_y += pSprite->screen->y - screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + event->root_x += pSprite->screen->x - firstScreen->x; + event->root_y += pSprite->screen->y - firstScreen->y; } #endif /* XINERAMA */ pSprite->hotPhys.x = event->root_x; @@ -1233,6 +1239,9 @@ PlayReleasedEvents(void) QdEventPtr qe; DeviceIntPtr dev; DeviceIntPtr pDev; +#ifdef XINERAMA + ScreenPtr firstScreen = dixGetFirstScreenPtr(); +#endif restart: xorg_list_for_each_entry_safe(qe, tmp, &syncEvents.pending, next) { @@ -1261,9 +1270,9 @@ PlayReleasedEvents(void) case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: - ev->root_x += screenInfo.screens[0]->x - + ev->root_x += firstScreen->x - pDev->spriteInfo->sprite->screen->x; - ev->root_y += screenInfo.screens[0]->y - + ev->root_y += firstScreen->y - pDev->spriteInfo->sprite->screen->y; break; default: @@ -3008,12 +3017,13 @@ PointInBorderSize(WindowPtr pWin, int x, int y) if (!noPanoramiXExtension && XineramaSetWindowPntrs(inputInfo.pointer, pWin)) { SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); XINERAMA_FOR_EACH_SCREEN_FORWARD_SKIP0({ if (RegionContainsPoint(&pSprite->windows[walkScreenIdx]->borderSize, - x + screenInfo.screens[0]->x - + x + firstScreen->x - walkScreen->x, - y + screenInfo.screens[0]->y - + y + firstScreen->y - walkScreen->y, &box)) return TRUE; }); @@ -3163,8 +3173,9 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) /* Motion events entering DIX get translated to Screen 0 coordinates. Replayed events have already been translated since they've entered DIX before */ - ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x; - ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ev->root_x += pSprite->screen->x - firstScreen->x; + ev->root_y += pSprite->screen->y - firstScreen->y; } else #endif /* XINERAMA */ @@ -3335,7 +3346,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) pSprite->spriteTrace = NULL; pSprite->spriteTraceSize = 0; pSprite->spriteTraceGood = 0; - pSprite->pEnqueueScreen = screenInfo.screens[0]; + pSprite->pEnqueueScreen = dixGetFirstScreenPtr(); pSprite->pDequeueScreen = pSprite->pEnqueueScreen; } pCursor = RefCursor(pCursor); @@ -3356,10 +3367,11 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) } #ifdef XINERAMA if (!noPanoramiXExtension) { - pSprite->hotLimits.x1 = -screenInfo.screens[0]->x; - pSprite->hotLimits.y1 = -screenInfo.screens[0]->y; - pSprite->hotLimits.x2 = PanoramiXPixWidth - screenInfo.screens[0]->x; - pSprite->hotLimits.y2 = PanoramiXPixHeight - screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + pSprite->hotLimits.x1 = -firstScreen->x; + pSprite->hotLimits.y1 = -firstScreen->y; + pSprite->hotLimits.x2 = PanoramiXPixWidth - firstScreen->x; + pSprite->hotLimits.y2 = PanoramiXPixHeight - firstScreen->y; pSprite->physLimits = pSprite->hotLimits; pSprite->confineWin = NullWindow; pSprite->hotShape = NullRegion; @@ -3436,10 +3448,11 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) #ifdef XINERAMA if (!noPanoramiXExtension) { - pSprite->hotLimits.x1 = -screenInfo.screens[0]->x; - pSprite->hotLimits.y1 = -screenInfo.screens[0]->y; - pSprite->hotLimits.x2 = PanoramiXPixWidth - screenInfo.screens[0]->x; - pSprite->hotLimits.y2 = PanoramiXPixHeight - screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + pSprite->hotLimits.x1 = -firstScreen->x; + pSprite->hotLimits.y1 = -firstScreen->y; + pSprite->hotLimits.x2 = PanoramiXPixWidth - firstScreen->x; + pSprite->hotLimits.y2 = PanoramiXPixHeight - firstScreen->y; pSprite->physLimits = pSprite->hotLimits; pSprite->screen = pScreen; } @@ -3476,26 +3489,26 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) pSprite->hotPhys.y = y; #ifdef XINERAMA if (!noPanoramiXExtension) { - pSprite->hotPhys.x += newScreen->x - screenInfo.screens[0]->x; - pSprite->hotPhys.y += newScreen->y - screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + pSprite->hotPhys.x += newScreen->x - firstScreen->x; + pSprite->hotPhys.y += newScreen->y - firstScreen->y; if (newScreen != pSprite->screen) { pSprite->screen = newScreen; /* Make sure we tell the DDX to update its copy of the screen */ if (pSprite->confineWin) XineramaConfineCursorToWindow(ptr, pSprite->confineWin, TRUE); else - XineramaConfineCursorToWindow(ptr, screenInfo.screens[0]->root, - TRUE); + XineramaConfineCursorToWindow(ptr, firstScreen->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) (ptr, pSprite->screen, pSprite->hotPhys.x + - screenInfo.screens[0]-> + firstScreen-> x - pSprite->screen->x, pSprite->hotPhys.y + - screenInfo.screens[0]-> + firstScreen-> y - pSprite->screen->y, FALSE); } @@ -3523,8 +3536,10 @@ XineramaPointInWindowIsVisible(WindowPtr pWin, int x, int y) if (!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE; - xoff = x + screenInfo.screens[0]->x; - yoff = y + screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + xoff = x + firstScreen->x; + yoff = y + firstScreen->y; XINERAMA_FOR_EACH_SCREEN_FORWARD_SKIP0({ pWin = inputInfo.pointer->spriteInfo->sprite->windows[walkScreenIdx]; @@ -3560,6 +3575,8 @@ XineramaWarpPointer(ClientPtr client) x = pSprite->hotPhys.x; y = pSprite->hotPhys.y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + if (stuff->srcWid != None) { int winX, winY; XID winID = stuff->srcWid; @@ -3571,9 +3588,9 @@ XineramaWarpPointer(ClientPtr client) winX = source->drawable.x; winY = source->drawable.y; - if (source == screenInfo.screens[0]->root) { - winX -= screenInfo.screens[0]->x; - winY -= screenInfo.screens[0]->y; + if (source == firstScreen->root) { + winX -= firstScreen->x; + winY -= firstScreen->y; } if (x < winX + stuff->srcX || y < winY + stuff->srcY || @@ -3587,9 +3604,9 @@ XineramaWarpPointer(ClientPtr client) if (dest) { x = dest->drawable.x; y = dest->drawable.y; - if (dest == screenInfo.screens[0]->root) { - x -= screenInfo.screens[0]->x; - y -= screenInfo.screens[0]->y; + if (dest == firstScreen->root) { + x -= firstScreen->x; + y -= firstScreen->y; } } @@ -5354,11 +5371,12 @@ ProcQueryPointer(ClientPtr client) #ifdef XINERAMA if (!noPanoramiXExtension) { - rep.rootX += screenInfo.screens[0]->x; - rep.rootY += screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + rep.rootX += firstScreen->x; + rep.rootY += firstScreen->y; if (stuff->id == rep.root) { - rep.winX += screenInfo.screens[0]->x; - rep.winY += screenInfo.screens[0]->y; + rep.winX += firstScreen->x; + rep.winY += firstScreen->y; } } #endif /* XINERAMA */ @@ -6023,8 +6041,8 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) XkbFilterEvents(pClient, count, events); #ifdef XINERAMA - if (!noPanoramiXExtension && - (screenInfo.screens[0]->x || screenInfo.screens[0]->y)) { + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + if (!noPanoramiXExtension && (firstScreen->x || firstScreen->y)) { switch (events->u.u.type) { case MotionNotify: case ButtonPress: @@ -6040,12 +6058,12 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) */ count = 1; /* should always be 1 */ memcpy(&eventCopy, events, sizeof(xEvent)); - eventCopy.u.keyButtonPointer.rootX += screenInfo.screens[0]->x; - eventCopy.u.keyButtonPointer.rootY += screenInfo.screens[0]->y; + eventCopy.u.keyButtonPointer.rootX += firstScreen->x; + eventCopy.u.keyButtonPointer.rootY += firstScreen->y; if (eventCopy.u.keyButtonPointer.event == eventCopy.u.keyButtonPointer.root) { - eventCopy.u.keyButtonPointer.eventX += screenInfo.screens[0]->x; - eventCopy.u.keyButtonPointer.eventY += screenInfo.screens[0]->y; + eventCopy.u.keyButtonPointer.eventX += firstScreen->x; + eventCopy.u.keyButtonPointer.eventY += firstScreen->y; } events = &eventCopy; break; diff --git a/dix/gestures.c b/dix/gestures.c index d9fda18c7e..c0e192b38a 100644 --- a/dix/gestures.c +++ b/dix/gestures.c @@ -31,6 +31,7 @@ #include "dix/input_priv.h" #include "dix/inpututils_priv.h" #include "dix/resource_priv.h" +#include "dix/screenint_priv.h" #include "mi/mi_priv.h" #include "os/bug_priv.h" @@ -52,10 +53,12 @@ GestureInitGestureInfo(GestureInfoPtr gi) if (!gi->sprite.spriteTrace) { return FALSE; } + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + gi->sprite.spriteTraceSize = 32; - gi->sprite.spriteTrace[0] = screenInfo.screens[0]->root; - gi->sprite.hot.pScreen = screenInfo.screens[0]; - gi->sprite.hotPhys.pScreen = screenInfo.screens[0]; + gi->sprite.spriteTrace[0] = firstScreen->root; + gi->sprite.hot.pScreen = firstScreen; + gi->sprite.hotPhys.pScreen = firstScreen; return TRUE; } diff --git a/dix/getevents.c b/dix/getevents.c index 553b794f80..c20049faa1 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -42,6 +42,7 @@ #include "dix/input_priv.h" #include "dix/inpututils_priv.h" +#include "dix/screenint_priv.h" #include "mi/mi_priv.h" #include "os/bug_priv.h" #include "os/probes_priv.h" @@ -2119,8 +2120,9 @@ PostSyntheticMotion(DeviceIntPtr pDev, will translate from sprite screen to screen 0 upon reentry to the DIX layer. */ if (!noPanoramiXExtension) { - x += screenInfo.screens[0]->x - screenInfo.screens[screen]->x; - y += screenInfo.screens[0]->y - screenInfo.screens[screen]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + x += firstScreen->x - screenInfo.screens[screen]->x; + y += firstScreen->y - screenInfo.screens[screen]->y; } #endif /* XINERAMA */ diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c index d71a9a4057..ea7951c8da 100644 --- a/dix/glyphcurs.c +++ b/dix/glyphcurs.c @@ -47,6 +47,7 @@ SOFTWARE. #include #include "dix/cursor_priv.h" +#include "dix/screenint_priv.h" #include "misc.h" #include @@ -74,7 +75,6 @@ int ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned char **ppbits) { - ScreenPtr pScreen; GCPtr pGC; xRectangle rect; PixmapPtr ppix; @@ -86,7 +86,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, char2b[0] = (unsigned char) (ch >> 8); char2b[1] = (unsigned char) (ch & 0xff); - pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); pbits = calloc(BitmapBytePad(cm->width), cm->height); if (!pbits) return BadAlloc; diff --git a/dix/screenint_priv.h b/dix/screenint_priv.h index 616cfbfb67..98155936d2 100644 --- a/dix/screenint_priv.h +++ b/dix/screenint_priv.h @@ -8,7 +8,8 @@ #include -#include "screenint.h" +#include "include/screenint.h" +#include "include/scrnintstr.h" /* for screenInfo */ typedef Bool (*ScreenInitProcPtr)(ScreenPtr pScreen, int argc, char **argv); @@ -23,4 +24,8 @@ void DetachUnboundGPU(ScreenPtr unbound); void AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr newScreen); void DetachOffloadGPU(ScreenPtr slave); +static inline ScreenPtr dixGetFirstScreenPtr(void) { + return screenInfo.screens[0]; +} + #endif /* _XSERVER_DIX_SCREENINT_PRIV_H */ diff --git a/dix/touch.c b/dix/touch.c index 42df47b49c..e2e7bffb4a 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -33,6 +33,7 @@ #include "dix/input_priv.h" #include "dix/inpututils_priv.h" #include "dix/resource_priv.h" +#include "dix/screenint_priv.h" #include "mi/mi_priv.h" #include "os/bug_priv.h" #include "os/log_priv.h" @@ -221,9 +222,12 @@ TouchInitTouchPoint(TouchClassPtr t, ValuatorClassPtr v, int index) return FALSE; } ti->sprite.spriteTraceSize = 32; - ti->sprite.spriteTrace[0] = screenInfo.screens[0]->root; - ti->sprite.hot.pScreen = screenInfo.screens[0]; - ti->sprite.hotPhys.pScreen = screenInfo.screens[0]; + + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + ti->sprite.spriteTrace[0] = firstScreen->root; + ti->sprite.hot.pScreen = firstScreen; + ti->sprite.hotPhys.pScreen = firstScreen; ti->client_id = -1; diff --git a/dix/window.c b/dix/window.c index 4f6949cc73..1f58f0dc52 100644 --- a/dix/window.c +++ b/dix/window.c @@ -107,6 +107,7 @@ Equipment Corporation. #include "dix/inpututils_priv.h" #include "dix/property_priv.h" #include "dix/resource_priv.h" +#include "dix/screenint_priv.h" #include "dix/selection_priv.h" #include "dix/window_priv.h" #include "mi/mi_priv.h" /* miPaintWindow */ @@ -2268,8 +2269,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) event.u.u.detail = (mask & CWStackMode) ? smode : Above; #ifdef XINERAMA if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureRequest.x += screenInfo.screens[0]->x; - event.u.configureRequest.y += screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + event.u.configureRequest.x += firstScreen->x; + event.u.configureRequest.y += firstScreen->y; } #endif /* XINERAMA */ if (MaybeDeliverEventToClient(pParent, &event, @@ -2351,8 +2353,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) event.u.u.type = ConfigureNotify; #ifdef XINERAMA if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureNotify.x += screenInfo.screens[0]->x; - event.u.configureNotify.y += screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + event.u.configureNotify.x += firstScreen->x; + event.u.configureNotify.y += firstScreen->y; } #endif /* XINERAMA */ DeliverEvents(pWin, &event, 1, NullWindow); @@ -2496,8 +2499,9 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, event.u.u.type = ReparentNotify; #ifdef XINERAMA if (!noPanoramiXExtension && !pParent->parent) { - event.u.reparent.x += screenInfo.screens[0]->x; - event.u.reparent.y += screenInfo.screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + event.u.reparent.x += firstScreen->x; + event.u.reparent.y += firstScreen->y; } #endif /* XINERAMA */ DeliverEvents(pWin, &event, 1, pParent); diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 2d27eb37e4..3d77f2617f 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -61,6 +61,7 @@ #include "dix/input_priv.h" #include "dix/inpututils_priv.h" #include "dix/ptrveloc_priv.h" +#include "dix/screenint_priv.h" #include "xf86_priv.h" #include "xf86Priv.h" @@ -1525,11 +1526,11 @@ void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) { if (axnum == 0) { - dev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; + dev->valuator->axisVal[0] = dixGetFirstScreenPtr()->width / 2; dev->last.valuators[0] = dev->valuator->axisVal[0]; } else if (axnum == 1) { - dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; + dev->valuator->axisVal[1] = dixGetFirstScreenPtr()->height / 2; dev->last.valuators[1] = dev->valuator->axisVal[1]; } } diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 023388ad56..596436a9a4 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -34,6 +34,7 @@ #include #include +#include "dix/screenint_priv.h" #include "miext/extinit_priv.h" #include "os/ddx_priv.h" #include "os/log_priv.h" @@ -586,8 +587,10 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) { int i, left, top; - left = pScreenInfo->screens[0]->x; - top = pScreenInfo->screens[0]->y; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + + left = firstScreen->x; + top = firstScreen->y; /* Find leftmost screen. If there's a tie, take the topmost of the two. */ for (i = 1; i < pScreenInfo->numScreens; i++) { diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 4ca1dd9405..5ee308c68d 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -34,6 +34,7 @@ #include #include "dix/dix_priv.h" +#include "dix/screenint_priv.h" #include "quartzRandR.h" #include "inputstr.h" @@ -251,7 +252,7 @@ QuartzUpdateScreens(void) return; } - pScreen = screenInfo.screens[0]; + pScreen = dixGetFirstScreenPtr(); PseudoramiXResetScreens(); quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height, pScreen); diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c index ec04ea399f..8a1960e665 100644 --- a/hw/xquartz/quartzRandR.c +++ b/hw/xquartz/quartzRandR.c @@ -33,6 +33,8 @@ #include +#include "dix/screenint_priv.h" + #include "quartzRandR.h" #include "quartz.h" #include "darwin.h" @@ -424,7 +426,7 @@ _QuartzRandRUpdateFakeModes(ScreenPtr pScreen) Bool QuartzRandRUpdateFakeModes(BOOL force_update) { - ScreenPtr pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); if (ignore_next_fake_mode_update) { DEBUG_LOG( @@ -494,7 +496,7 @@ QuartzRandRSetFakeFullscreen(BOOL state) void QuartzRandRToggleFullscreen(void) { - ScreenPtr pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); if (pQuartzScreen->currentMode.ref == NULL) { diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 3577f97792..317ba4a009 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -35,6 +35,7 @@ #include #endif +#include "dix/screenint_priv.h" #include "mi/mi_priv.h" #include "win.h" @@ -256,8 +257,8 @@ winRestoreModeKeyStates(void) /* Only process events if the rootwindow is mapped. The keyboard events * will cause segfaults otherwise */ - if (screenInfo.screens[0]->root && - screenInfo.screens[0]->root->mapped == FALSE) + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + if (firstScreen->root && firstScreen->root->mapped == FALSE) processEvents = FALSE; /* Force to process all pending events in the mi event queue */ diff --git a/hw/xwin/winmsgwindow.c b/hw/xwin/winmsgwindow.c index 8792d779cc..2ef09eaa57 100644 --- a/hw/xwin/winmsgwindow.c +++ b/hw/xwin/winmsgwindow.c @@ -26,6 +26,8 @@ #include #endif +#include "dix/screenint_priv.h" + #include "win.h" /* @@ -56,7 +58,7 @@ winMsgWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) has set the DE_TERMINATE flag so exits the msg dispatch loop. */ { - ScreenPtr pScreen = screenInfo.screens[0]; + ScreenPtr pScreen = dixGetFirstScreenPtr(); winScreenPriv(pScreen); PostMessage(pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0); diff --git a/mi/miexpose.c b/mi/miexpose.c index 50d45ffba2..85e1924ffe 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -79,6 +79,7 @@ Equipment Corporation. #include #include "dix/dix_priv.h" +#include "dix/screenint_priv.h" #include "mi/mi_priv.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" @@ -327,7 +328,7 @@ miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy) if (!pWin->parent) { x = screenInfo.screens[scrnum]->x; y = screenInfo.screens[scrnum]->y; - pWin = screenInfo.screens[0]->root; + pWin = dixGetFirstScreenPtr()->root; realWin = pWin->drawable.id; } else if (scrnum) { diff --git a/record/record.c b/record/record.c index 55558fb339..6738d2b01b 100644 --- a/record/record.c +++ b/record/record.c @@ -44,6 +44,7 @@ and Jim Haggerty of Metheus. #include "dix/eventconvert.h" #include "dix/input_priv.h" #include "dix/resource_priv.h" +#include "dix/screenint_priv.h" #include "miext/extinit_priv.h" #include "os/client_priv.h" #include "os/osdep.h" @@ -725,12 +726,13 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP, pev->u.u.type == ButtonRelease || pev->u.u.type == KeyPress || pev->u.u.type == KeyRelease)) { int scr = inputInfo.pointer->spriteInfo->sprite->screen->myNum; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); memcpy(&shiftedEvent, pev, sizeof(xEvent)); shiftedEvent.u.keyButtonPointer.rootX += - screenInfo.screens[scr]->x - screenInfo.screens[0]->x; + screenInfo.screens[scr]->x - firstScreen->x; shiftedEvent.u.keyButtonPointer.rootY += - screenInfo.screens[scr]->y - screenInfo.screens[0]->y; + screenInfo.screens[scr]->y - firstScreen->y; pEvToRecord = &shiftedEvent; } #endif /* XINERAMA */ diff --git a/render/filter.c b/render/filter.c index 0faf4f5f95..463fb4fb15 100644 --- a/render/filter.c +++ b/render/filter.c @@ -25,6 +25,8 @@ #define XK_LATIN1 #include +#include "dix/screenint_priv.h" + #include "misc.h" #include "scrnintstr.h" #include "os.h" @@ -329,7 +331,7 @@ SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params, if (pPicture->pDrawable != NULL) pScreen = pPicture->pDrawable->pScreen; else - pScreen = screenInfo.screens[0]; + pScreen = dixGetFirstScreenPtr(); pFilter = PictureFindFilter(pScreen, name, len); @@ -360,7 +362,7 @@ SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter, if (pPicture->pDrawable) pScreen = pPicture->pDrawable->pScreen; else - pScreen = screenInfo.screens[0]; + pScreen = dixGetFirstScreenPtr(); if (pFilter->ValidateParams) { int width, height; diff --git a/render/render.c b/render/render.c index 2b42aa798c..1f07fc93fa 100644 --- a/render/render.c +++ b/render/render.c @@ -34,6 +34,7 @@ #include "dix/colormap_priv.h" #include "dix/cursor_priv.h" #include "dix/dix_priv.h" +#include "dix/screenint_priv.h" #include "miext/extinit_priv.h" #include "os/osdep.h" #include "Xext/panoramiX.h" @@ -2505,7 +2506,7 @@ PanoramiXRenderCreatePicture(ClientPtr client) panoramix_setup_ids(newPict, client, stuff->pid); if (refDraw->type == XRT_WINDOW && - stuff->drawable == screenInfo.screens[0]->root->drawable.id) { + stuff->drawable == dixGetFirstScreenPtr()->root->drawable.id) { newPict->u.pict.root = TRUE; } else diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c index 397b707f59..5144f93b68 100644 --- a/test/xi2/protocol-common.c +++ b/test/xi2/protocol-common.c @@ -33,6 +33,7 @@ #include "dix/atom_priv.h" #include "dix/dix_priv.h" #include "dix/exevents_priv.h" +#include "dix/screenint_priv.h" #include "miext/extinit_priv.h" #include "xkb/xkbsrv_priv.h" /* for XkbInitPrivates */ @@ -109,9 +110,10 @@ TestPointerProc(DeviceIntPtr pDev, int what) pDev->name); return BadAlloc; } - pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; + ScreenPtr firstScreen = dixGetFirstScreenPtr(); + pDev->valuator->axisVal[0] = firstScreen->width / 2; pDev->last.valuators[0] = pDev->valuator->axisVal[0]; - pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; + pDev->valuator->axisVal[1] = firstScreen->height / 2; pDev->last.valuators[1] = pDev->valuator->axisVal[1]; /* protocol-xiquerydevice.c relies on these increment */ diff --git a/xfixes/cursor.c b/xfixes/cursor.c index b37bde034f..feb41b13f6 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -49,6 +49,7 @@ #include "dix/input_priv.h" #include "dix/rpcbuf_priv.h" #include "dix/screen_hooks_priv.h" +#include "dix/screenint_priv.h" #include "xfixesint.h" #include "scrnintstr.h" @@ -618,7 +619,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) } } /* this "knows" that WindowHasNewCursor doesn't depend on its argument */ - WindowHasNewCursor(screenInfo.screens[0]->root); + WindowHasNewCursor(dixGetFirstScreenPtr()->root); } static Bool diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 44ae06ab35..26d515f502 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -39,6 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include "dix/screenint_priv.h" #include "os/bug_priv.h" #include "os/cmdline.h" #include "os/log_priv.h" @@ -192,7 +193,7 @@ XkbWriteRulesProp(void) ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n", out, len); } - dixChangeWindowProperty(serverClient, screenInfo.screens[0]->root, name, + dixChangeWindowProperty(serverClient, dixGetFirstScreenPtr()->root, name, XA_STRING, 8, PropModeReplace, len, pval, TRUE); free(pval); return TRUE;