xserver: Branch 'master' - 12 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jun 3 15:13:07 PDT 2010


 Xext/panoramiX.c                      |  103 +++++-------
 Xext/panoramiX.h                      |    7 
 Xext/panoramiXprocs.c                 |  192 +++++++++++------------
 Xext/panoramiXsrv.h                   |    3 
 Xext/saver.c                          |   18 +-
 Xext/shm.c                            |   12 -
 Xext/xvdisp.c                         |   16 -
 Xi/closedev.c                         |    2 
 Xi/exevents.c                         |    6 
 Xi/xichangecursor.c                   |    2 
 Xi/xiquerypointer.c                   |    9 -
 composite/compinit.c                  |    2 
 composite/compoverlay.c               |    2 
 composite/compwindow.c                |    2 
 dix/devices.c                         |    6 
 dix/dispatch.c                        |   13 -
 dix/enterleave.c                      |   12 -
 dix/events.c                          |  179 ++++++++++------------
 dix/getevents.c                       |    4 
 dix/globals.c                         |    4 
 dix/main.c                            |    5 
 dix/window.c                          |  102 ++++++------
 fb/fb.h                               |    2 
 hw/dmx/dmxcursor.c                    |   62 ++++---
 hw/dmx/dmxextension.c                 |   26 +--
 hw/dmx/doc/dmx.xml                    |   15 -
 hw/dmx/input/dmxcommon.c              |    9 -
 hw/dmx/input/dmxconsole.c             |   25 +--
 hw/dmx/input/dmxinputinit.c           |    6 
 hw/dmx/input/dmxinputinit.h           |    4 
 hw/kdrive/src/kdrive.c                |    7 
 hw/xfree86/common/xf86Cursor.c        |   94 +++++------
 hw/xfree86/common/xf86Helper.c        |    2 
 hw/xfree86/common/xf86RandR.c         |    2 
 hw/xfree86/common/xf86xv.c            |    2 
 hw/xfree86/dixmods/extmod/xf86vmode.c |    2 
 hw/xfree86/dri/dri.c                  |    2 
 hw/xfree86/dri2/dri2.c                |    2 
 hw/xfree86/fbdevhw/Makefile.am        |    3 
 hw/xfree86/modes/xf86RandR12.c        |    6 
 hw/xfree86/modes/xf86Rotate.c         |    4 
 hw/xfree86/xaa/xaaCpyWin.c            |    2 
 hw/xfree86/xaa/xaaOverlay.c           |    2 
 hw/xfree86/xaa/xaaOverlayDF.c         |    2 
 hw/xquartz/applewm.c                  |    6 
 hw/xquartz/darwin.c                   |   24 +-
 hw/xquartz/darwinEvents.c             |    4 
 hw/xquartz/pseudoramiX.c              |    4 
 hw/xquartz/quartz.c                   |   14 -
 hw/xquartz/xpr/xprCursor.c            |    4 
 hw/xquartz/xpr/xprFrame.c             |    2 
 hw/xquartz/xpr/xprScreen.c            |    4 
 hw/xwin/winkeybd.c                    |    2 
 hw/xwin/winscrinit.c                  |    6 
 hw/xwin/winwin32rootlesswindow.c      |    2 
 hw/xwin/winwindow.c                   |    2 
 include/globals.h                     |    3 
 include/scrnintstr.h                  |   14 +
 include/windowstr.h                   |   13 -
 mi/midispcur.c                        |  276 +---------------------------------
 mi/miexpose.c                         |    6 
 mi/mioverlay.c                        |    6 
 mi/misprite.c                         |   70 --------
 mi/misprite.h                         |    7 
 miext/rootless/rootlessCommon.c       |    4 
 miext/rootless/rootlessCommon.h       |    2 
 miext/rootless/rootlessScreen.c       |    2 
 miext/rootless/rootlessWindow.c       |   26 +--
 randr/rrscreen.c                      |   10 -
 randr/rrxinerama.c                    |    2 
 record/record.c                       |    9 -
 render/render.c                       |   46 ++---
 xfixes/cursor.c                       |    2 
 xkb/xkbInit.c                         |    3 
 74 files changed, 598 insertions(+), 959 deletions(-)

New commits:
commit 0f12e86e600522768f5f64eafc1230526e700ab7
Merge: aa7c09f... f114f54...
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jun 3 15:09:32 2010 -0700

    Merge remote branch 'jamey/for-keith'

commit f114f54986aca1add4c8808a05d9692e289547e7
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri Apr 23 19:33:49 2010 -0700

    Accumulate graphics exposures incrementally in PanoramiXCopyArea/Plane.
    
    This fuses two loops in each function, eliminating an intermediate
    MAXSCREENS-sized array from each.
    
    Aside from being more efficient, I believe this is equivalent to the
    previous implementation, since
    - each per-screen GC has the graphicsExposures flag set the same way,
      and
    - the REGION_* macros ignore their screen argument.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index a7f8a0c..5ccbe27 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1084,10 +1084,12 @@ int PanoramiXCopyArea(ClientPtr client)
     } else {
 	DrawablePtr pDst = NULL, pSrc = NULL;
 	GCPtr pGC = NULL;
-	RegionPtr pRgn[MAXSCREENS];
+	RegionRec totalReg;
 	int rc;
 
+	REGION_NULL(unusedScreen, &totalReg);
 	FOR_NSCREENS_BACKWARD(j) {
+	    RegionPtr pRgn;
 	    stuff->dstDrawable = dst->info[j].id;
 	    stuff->srcDrawable = src->info[j].id;
 	    stuff->gc          = gc->info[j].id;
@@ -1116,37 +1118,30 @@ int PanoramiXCopyArea(ClientPtr client)
  	    } else
 		pSrc = pDst;
 
-	    pRgn[j] = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, 
+	    pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
 				stuff->srcX, stuff->srcY,
 				stuff->width, stuff->height, 
 				stuff->dstX, stuff->dstY);
+	    if(pGC->graphicsExposures && pRgn) {
+	       if(srcIsRoot) {
+		   REGION_TRANSLATE(unusedScreen, pRgn,
+			    screenInfo.screens[j]->x, screenInfo.screens[j]->y);
+	       }
+	       REGION_APPEND(unusedScreen, &totalReg, pRgn);
+	       REGION_DESTROY(unusedScreen, pRgn);
+	    }
 
-	    if(dstShared) {
-		while(j--) pRgn[j] = NULL;
+	    if(dstShared)
 		break;
-	    }
 	}
 
 	if(pGC->graphicsExposures) {
 	    ScreenPtr pScreen = pDst->pScreen;
-	    RegionRec totalReg;
 	    Bool overlap;
-
-	    REGION_NULL(pScreen, &totalReg);
-	    FOR_NSCREENS_BACKWARD(j) {
-		if(pRgn[j]) {
-		   if(srcIsRoot) {
-		       REGION_TRANSLATE(pScreen, pRgn[j], 
-				screenInfo.screens[j]->x, screenInfo.screens[j]->y);
-		   }
-		   REGION_APPEND(pScreen, &totalReg, pRgn[j]);
-		   REGION_DESTROY(pScreen, pRgn[j]);
-		}
-	    }
-	    REGION_VALIDATE(pScreen, &totalReg, &overlap);
+	    REGION_VALIDATE(unusedScreen, &totalReg, &overlap);
 	    (*pScreen->SendGraphicsExpose)(
 		client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
-	    REGION_UNINIT(pScreen, &totalReg);
+	    REGION_UNINIT(unusedScreen, &totalReg);
 	}
     }
 
@@ -1163,7 +1158,7 @@ int PanoramiXCopyPlane(ClientPtr client)
     Bool		srcShared, dstShared;
     DrawablePtr 	psrcDraw, pdstDraw = NULL;
     GCPtr 		pGC = NULL;
-    RegionPtr 		pRgn[MAXSCREENS];
+    RegionRec		totalReg;
     REQUEST(xCopyPlaneReq);
 
     REQUEST_SIZE_MATCH(xCopyPlaneReq);
@@ -1198,7 +1193,9 @@ int PanoramiXCopyPlane(ClientPtr client)
     srcx = stuff->srcX; srcy = stuff->srcY;
     dstx = stuff->dstX; dsty = stuff->dstY;
  
+    REGION_NULL(unusedScreen, &totalReg);
     FOR_NSCREENS_BACKWARD(j) {
+	RegionPtr pRgn;
 	stuff->dstDrawable = dst->info[j].id;
 	stuff->srcDrawable = src->info[j].id;
 	stuff->gc          = gc->info[j].id;
@@ -1231,33 +1228,26 @@ int PanoramiXCopyPlane(ClientPtr client)
 	    return(BadValue);
 	}
 
-	pRgn[j] = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, 
+	pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC,
 				stuff->srcX, stuff->srcY,
 				stuff->width, stuff->height, 
 				stuff->dstX, stuff->dstY, stuff->bitPlane);
+	if(pGC->graphicsExposures && pRgn) {
+	    REGION_APPEND(unusedScreen, &totalReg, pRgn);
+	    REGION_DESTROY(unusedScreen, pRgn);
+	}
 
-	if(dstShared) {
-	    while(j--) pRgn[j] = NULL;
+	if(dstShared)
 	    break;
-	}
     }
 
     if(pGC->graphicsExposures) {
 	ScreenPtr pScreen = pdstDraw->pScreen;
-	RegionRec totalReg;
 	Bool overlap;
-
-	REGION_NULL(pScreen, &totalReg);
-	FOR_NSCREENS_BACKWARD(j) {
-	    if(pRgn[j]) {
-		REGION_APPEND(pScreen, &totalReg, pRgn[j]);
-		REGION_DESTROY(pScreen, pRgn[j]);
-	    }
-	}
-	REGION_VALIDATE(pScreen, &totalReg, &overlap);
+	REGION_VALIDATE(unusedScreen, &totalReg, &overlap);
 	(*pScreen->SendGraphicsExpose)(
 		client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
-	REGION_UNINIT(pScreen, &totalReg);
+	REGION_UNINIT(unusedScreen, &totalReg);
     }
 
     return Success;
commit a7c7ebe4b3a0df1a4d1ffe3c690cfb21470f103d
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 22 21:13:48 2010 -0700

    Delete XineramaScreenRegions cache.
    
    Every screen region consists of a single rectangle, so initializing a
    stack-allocated region for each screen on-demand does no heap allocation
    and is fast.
    
    This eliminates a MAXSCREENS-sized array.
    
    The REGION_UNINIT calls are no-ops since no boxes are actually allocated
    for a single-rectangle region, but it seemed wiser to include them.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 78728a9..14e06e1 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -119,8 +119,6 @@ typedef struct {
   CloseScreenProcPtr	CloseScreen;
 } PanoramiXScreenRec, *PanoramiXScreenPtr;
 
-static RegionRec XineramaScreenRegions[MAXSCREENS];
-
 static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
 static void XineramaChangeGC(GCPtr, unsigned long);
 static void XineramaCopyGC(GCPtr, unsigned long, GCPtr);
@@ -153,7 +151,6 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
     pScreen->CreateGC = pScreenPriv->CreateGC;
 
-    REGION_UNINIT(pScreen, &XineramaScreenRegions[pScreen->myNum]);
     if (pScreen->myNum == 0)
 	REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
 
@@ -392,6 +389,7 @@ static void XineramaInitData(ScreenPtr pScreen)
     REGION_NULL(pScreen, &PanoramiXScreenRegion)
     for (i = 0; i < PanoramiXNumScreens; i++) {
 	BoxRec TheBox;
+	RegionRec ScreenRegion;
 
         pScreen = screenInfo.screens[i];
 
@@ -400,9 +398,10 @@ static void XineramaInitData(ScreenPtr pScreen)
 	TheBox.y1 = pScreen->y;
 	TheBox.y2 = TheBox.y1 + pScreen->height;
 
-	REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1);
+	REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1);
 	REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion,
-		     &XineramaScreenRegions[i]);
+		     &ScreenRegion);
+	REGION_UNINIT(pScreen, &ScreenRegion);
     }
 
     PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
@@ -422,12 +421,7 @@ static void XineramaInitData(ScreenPtr pScreen)
 
 void XineramaReinitData(ScreenPtr pScreen)
 {
-    int i;
-
     REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
-    for (i = 0; i < PanoramiXNumScreens; i++)
-	REGION_UNINIT(pScreen, &XineramaScreenRegions[i]);
-
     XineramaInitData(pScreen);
 }
 
@@ -1141,7 +1135,7 @@ XineramaGetImageData(
     int pitch,
     Bool isRoot
 ){
-    RegionRec SrcRegion, GrabRegion;
+    RegionRec SrcRegion, ScreenRegion, GrabRegion;
     BoxRec SrcBox, *pbox;
     int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth;
     DrawablePtr pDraw = pDrawables[0];
@@ -1165,12 +1159,24 @@ XineramaGetImageData(
     depth = (format == XYPixmap) ? 1 : pDraw->depth;
 
     for(i = 0; i < PanoramiXNumScreens; i++) {
+	BoxRec TheBox;
+	ScreenPtr pScreen;
 	pDraw = pDrawables[i];
+	pScreen = pDraw->pScreen;
 
-	inOut = RECT_IN_REGION(pScreen,&XineramaScreenRegions[i],&SrcBox);
+	TheBox.x1 = pScreen->x;
+	TheBox.x2 = TheBox.x1 + pScreen->width;
+	TheBox.y1 = pScreen->y;
+	TheBox.y2 = TheBox.y1 + pScreen->height;
+
+	REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1);
+	inOut = RECT_IN_REGION(pScreen, &ScreenRegion, &SrcBox);
+	if(inOut == rgnPART)
+	    REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion, &ScreenRegion);
+	REGION_UNINIT(pScreen, &ScreenRegion);
 
 	if(inOut == rgnIN) {	   
-	    (*pDraw->pScreen->GetImage)(pDraw, 
+	    (*pScreen->GetImage)(pDraw,
 			SrcBox.x1 - pDraw->x - screenInfo.screens[i]->x,
 			SrcBox.y1 - pDraw->y - screenInfo.screens[i]->y,
 			width, height, format, planemask, data);
@@ -1178,9 +1184,6 @@ XineramaGetImageData(
 	} else if (inOut == rgnOUT)
 	    continue;
 
-	REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion, 
-					&XineramaScreenRegions[i]);
-
 	nbox = REGION_NUM_RECTS(&GrabRegion);
 
 	if(nbox) {
@@ -1206,7 +1209,7 @@ XineramaGetImageData(
 		x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x;
 		y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y;
 
-		(*pDraw->pScreen->GetImage)(pDraw, x, y, w, h, 
+		(*pScreen->GetImage)(pDraw, x, y, w, h,
 					format, planemask, ScratchMem);
 		
 		/* copy the memory over */
diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml
index d0c83bb..c6dc0cc 100644
--- a/hw/dmx/doc/dmx.xml
+++ b/hw/dmx/doc/dmx.xml
@@ -1507,8 +1507,7 @@ PanoramiX prefix.
     Xinerama windows, pixmaps and colormaps.
     </para>
 
-    <para>A region (XineramaScreenRegions&lsqb;i&rsqb;) is initialized for each
-    physical screen, and single region (PanoramiXScreenRegion) is
+    <para>A region (PanoramiXScreenRegion) is
     initialized to be the union of the screen regions.
     The relative positioning information for the
     physical screens is taken from the ScreenRec x and y members, which
commit a0456da339fa9b3c3e6fead060338ee7348d6460
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sun May 23 12:57:52 2010 -0700

    XineramaSetCursorPosition: use screen bounds directly, not POINT_IN_REGION.
    
    This hides a MAXSCREENS-sized array as an implementation detail of
    panoramiX.c rather than an exported global.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index b87da24..78728a9 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -119,7 +119,7 @@ typedef struct {
   CloseScreenProcPtr	CloseScreen;
 } PanoramiXScreenRec, *PanoramiXScreenPtr;
 
-RegionRec XineramaScreenRegions[MAXSCREENS];
+static RegionRec XineramaScreenRegions[MAXSCREENS];
 
 static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
 static void XineramaChangeGC(GCPtr, unsigned long);
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index af0017d..5b1a3a9 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -21,8 +21,6 @@ extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
 
 extern _X_EXPORT void XineramaReinitData(ScreenPtr);
 
-extern _X_EXPORT RegionRec XineramaScreenRegions[MAXSCREENS];
-
 extern _X_EXPORT unsigned long XRC_DRAWABLE;
 extern _X_EXPORT unsigned long XRT_WINDOW;
 extern _X_EXPORT unsigned long XRT_PIXMAP;
diff --git a/dix/events.c b/dix/events.c
index e8e65e2..502eebd 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -486,6 +486,13 @@ SyntheticMotion(DeviceIntPtr dev, int x, int y) {
 static void PostNewCursor(DeviceIntPtr pDev);
 
 static Bool
+pointOnScreen(ScreenPtr pScreen, int x, int y)
+{
+    return x >= pScreen->x && x < pScreen->x + pScreen->width &&
+           y >= pScreen->y && y < pScreen->y + pScreen->height;
+}
+
+static Bool
 XineramaSetCursorPosition(
     DeviceIntPtr pDev,
     int x,
@@ -493,7 +500,6 @@ XineramaSetCursorPosition(
     Bool generateEvent
 ){
     ScreenPtr pScreen;
-    BoxRec box;
     int i;
     SpritePtr pSprite = pDev->spriteInfo->sprite;
 
@@ -505,14 +511,13 @@ XineramaSetCursorPosition(
     x += screenInfo.screens[0]->x;
     y += screenInfo.screens[0]->y;
 
-    if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
-								x, y, &box))
+    if(!pointOnScreen(pScreen, x, y))
     {
 	FOR_NSCREENS(i)
 	{
 	    if(i == pScreen->myNum)
 		continue;
-	    if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
+	    if(pointOnScreen(screenInfo.screens[i], x, y))
 	    {
 		pScreen = screenInfo.screens[i];
 		break;
commit a83cff9f4d622b069c96a68b4e87a669bf1f6446
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sun May 23 10:11:47 2010 -0700

    Move each screen's x/y origin into ScreenRec.
    
    Many references to the dixScreenOrigins array already had the
    corresponding screen pointer handy, which meant they usually looked like
    "dixScreenOrigins[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 declared the dixScreenOrigins array, I figure allocating a
    screen private for these values is overkill.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 5f0e97e..b87da24 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -198,8 +198,8 @@ XineramaValidateGC(
 
     if((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr)pDraw)->parent)) {
 	/* the root window */
-	int x_off = dixScreenOrigins[pGC->pScreen->myNum].x;
-	int y_off = dixScreenOrigins[pGC->pScreen->myNum].y;
+	int x_off = pGC->pScreen->x;
+	int y_off = pGC->pScreen->y;
 	int new_val;
 
 	new_val = pGCPriv->clipOrg.x - x_off;
@@ -395,9 +395,9 @@ static void XineramaInitData(ScreenPtr pScreen)
 
         pScreen = screenInfo.screens[i];
 
-	TheBox.x1 = dixScreenOrigins[i].x;
+	TheBox.x1 = pScreen->x;
 	TheBox.x2 = TheBox.x1 + pScreen->width;
-	TheBox.y1 = dixScreenOrigins[i].y;
+	TheBox.y1 = pScreen->y;
 	TheBox.y2 = TheBox.y1 + pScreen->height;
 
 	REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1);
@@ -405,13 +405,13 @@ static void XineramaInitData(ScreenPtr pScreen)
 		     &XineramaScreenRegions[i]);
     }
 
-    PanoramiXPixWidth = dixScreenOrigins[0].x + screenInfo.screens[0]->width;
-    PanoramiXPixHeight = dixScreenOrigins[0].y + screenInfo.screens[0]->height;
+    PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
+    PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height;
 
     for (i = 1; i < PanoramiXNumScreens; i++) {
 	pScreen = screenInfo.screens[i];
-	w = dixScreenOrigins[i].x + pScreen->width;
-	h = dixScreenOrigins[i].y + pScreen->height;
+	w = pScreen->x + pScreen->width;
+	h = pScreen->y + pScreen->height;
 
 	if (PanoramiXPixWidth < w)
 	    PanoramiXPixWidth = w;
@@ -1060,8 +1060,8 @@ ProcXineramaQueryScreens(ClientPtr client)
 	int i;
 
 	for(i = 0; i < PanoramiXNumScreens; i++) {
-	    scratch.x_org  = dixScreenOrigins[i].x;
-	    scratch.y_org  = dixScreenOrigins[i].y;
+	    scratch.x_org  = screenInfo.screens[i]->x;
+	    scratch.y_org  = screenInfo.screens[i]->y;
 	    scratch.width  = screenInfo.screens[i]->width;
 	    scratch.height = screenInfo.screens[i]->height;
 	
@@ -1153,8 +1153,8 @@ XineramaGetImageData(
     SrcBox.x1 = left;
     SrcBox.y1 = top;
     if(!isRoot) {
-	SrcBox.x1 += pDraw->x + dixScreenOrigins[0].x;
-	SrcBox.y1 += pDraw->y + dixScreenOrigins[0].y;
+	SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x;
+	SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y;
     }
     SrcBox.x2 = SrcBox.x1 + width;
     SrcBox.y2 = SrcBox.y1 + height;
@@ -1171,8 +1171,8 @@ XineramaGetImageData(
 
 	if(inOut == rgnIN) {	   
 	    (*pDraw->pScreen->GetImage)(pDraw, 
-			SrcBox.x1 - pDraw->x - dixScreenOrigins[i].x,
-			SrcBox.y1 - pDraw->y - dixScreenOrigins[i].y,
+			SrcBox.x1 - pDraw->x - screenInfo.screens[i]->x,
+			SrcBox.y1 - pDraw->y - screenInfo.screens[i]->y,
 			width, height, format, planemask, data);
 	    break;
 	} else if (inOut == rgnOUT)
@@ -1203,8 +1203,8 @@ XineramaGetImageData(
 		    }	
 		}
 
-		x = pbox->x1 - pDraw->x - dixScreenOrigins[i].x;
-		y = pbox->y1 - pDraw->y - dixScreenOrigins[i].y;
+		x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x;
+		y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y;
 
 		(*pDraw->pScreen->GetImage)(pDraw, x, y, w, h, 
 					format, planemask, ScratchMem);
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index ccd7216..a7f8a0c 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -135,8 +135,8 @@ int PanoramiXCreateWindow(ClientPtr client)
         stuff->wid = newWin->info[j].id;
         stuff->parent = parent->info[j].id;
 	if (parentIsRoot) {
-	    stuff->x = orig_x - dixScreenOrigins[j].x;
-	    stuff->y = orig_y - dixScreenOrigins[j].y;
+	    stuff->x = orig_x - screenInfo.screens[j]->x;
+	    stuff->y = orig_y - screenInfo.screens[j]->y;
 	}
 	if (backPix)
 	    *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
@@ -334,8 +334,8 @@ int PanoramiXReparentWindow(ClientPtr client)
 	stuff->window = win->info[j].id;
 	stuff->parent = parent->info[j].id;
 	if(parentIsRoot) {
-	    stuff->x = x - dixScreenOrigins[j].x;
-	    stuff->y = y - dixScreenOrigins[j].y;
+	    stuff->x = x - screenInfo.screens[j]->x;
+	    stuff->y = y - screenInfo.screens[j]->y;
 	}
 	result = (*SavedProcVector[X_ReparentWindow])(client);
         if(result != Success) break;
@@ -495,9 +495,9 @@ int PanoramiXConfigureWindow(ClientPtr client)
 	if(sib)
 	    *((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id;
 	if(x_offset >= 0)
-	    *((CARD32 *) &stuff[1] + x_offset) = x - dixScreenOrigins[j].x;
+	    *((CARD32 *) &stuff[1] + x_offset) = x - screenInfo.screens[j]->x;
 	if(y_offset >= 0)
-	    *((CARD32 *) &stuff[1] + y_offset) = y - dixScreenOrigins[j].y;
+	    *((CARD32 *) &stuff[1] + y_offset) = y - screenInfo.screens[j]->y;
 	result = (*SavedProcVector[X_ConfigureWindow])(client);
         if(result != Success) break;
     }
@@ -565,8 +565,8 @@ int PanoramiXGetGeometry(ClientPtr client)
 	if((pWin->parent == screenInfo.screens[0]->root) ||
            (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid))
         {
-	   rep.x += dixScreenOrigins[0].x;
-	   rep.y += dixScreenOrigins[0].y;
+	   rep.x += screenInfo.screens[0]->x;
+	   rep.y += screenInfo.screens[0]->y;
 	}
 	rep.borderWidth = pWin->borderWidth;
     }
@@ -599,8 +599,8 @@ int PanoramiXTranslateCoords(ClientPtr client)
     if((pWin == screenInfo.screens[0]->root) ||
        (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
     { 
-	x = stuff->srcX - dixScreenOrigins[0].x;
-	y = stuff->srcY - dixScreenOrigins[0].y;
+	x = stuff->srcX - screenInfo.screens[0]->x;
+	y = stuff->srcY - screenInfo.screens[0]->y;
     } else {
 	x = pWin->drawable.x + stuff->srcX;
 	y = pWin->drawable.y + stuff->srcY;
@@ -637,8 +637,8 @@ int PanoramiXTranslateCoords(ClientPtr client)
     if((pDst == screenInfo.screens[0]->root) ||
        (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
     {
-	rep.dstX += dixScreenOrigins[0].x;
-	rep.dstY += dixScreenOrigins[0].y;
+	rep.dstX += screenInfo.screens[0]->x;
+	rep.dstY += screenInfo.screens[0]->y;
     }
 
     WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
@@ -981,8 +981,8 @@ int PanoramiXClearToBackground(ClientPtr client)
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->window = win->info[j].id;
 	if(isRoot) {
-	    stuff->x = x - dixScreenOrigins[j].x;
-	    stuff->y = y - dixScreenOrigins[j].y;
+	    stuff->x = x - screenInfo.screens[j]->x;
+	    stuff->y = y - screenInfo.screens[j]->y;
 	}
 	result = (*SavedProcVector[X_ClearArea])(client);
 	if(result != Success) break;
@@ -1092,12 +1092,12 @@ int PanoramiXCopyArea(ClientPtr client)
 	    stuff->srcDrawable = src->info[j].id;
 	    stuff->gc          = gc->info[j].id;
  	    if (srcIsRoot) {	
-		stuff->srcX = srcx - dixScreenOrigins[j].x;
-		stuff->srcY = srcy - dixScreenOrigins[j].y;
+		stuff->srcX = srcx - screenInfo.screens[j]->x;
+		stuff->srcY = srcy - screenInfo.screens[j]->y;
 	    }
  	    if (dstIsRoot) {	
-		stuff->dstX = dstx - dixScreenOrigins[j].x;
-		stuff->dstY = dsty - dixScreenOrigins[j].y;
+		stuff->dstX = dstx - screenInfo.screens[j]->x;
+		stuff->dstY = dsty - screenInfo.screens[j]->y;
 	    }
 
 	    VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
@@ -1137,7 +1137,7 @@ int PanoramiXCopyArea(ClientPtr client)
 		if(pRgn[j]) {
 		   if(srcIsRoot) {
 		       REGION_TRANSLATE(pScreen, pRgn[j], 
-				dixScreenOrigins[j].x, dixScreenOrigins[j].y);
+				screenInfo.screens[j]->x, screenInfo.screens[j]->y);
 		   }
 		   REGION_APPEND(pScreen, &totalReg, pRgn[j]);
 		   REGION_DESTROY(pScreen, pRgn[j]);
@@ -1203,12 +1203,12 @@ int PanoramiXCopyPlane(ClientPtr client)
 	stuff->srcDrawable = src->info[j].id;
 	stuff->gc          = gc->info[j].id;
 	if (srcIsRoot) {	
-	    stuff->srcX = srcx - dixScreenOrigins[j].x;
-	    stuff->srcY = srcy - dixScreenOrigins[j].y;
+	    stuff->srcX = srcx - screenInfo.screens[j]->x;
+	    stuff->srcY = srcy - screenInfo.screens[j]->y;
 	}
 	if (dstIsRoot) {	
-	    stuff->dstX = dstx - dixScreenOrigins[j].x;
-	    stuff->dstY = dsty - dixScreenOrigins[j].y;
+	    stuff->dstX = dstx - screenInfo.screens[j]->x;
+	    stuff->dstY = dsty - screenInfo.screens[j]->y;
 	}
 
 	VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
@@ -1297,8 +1297,8 @@ int PanoramiXPolyPoint(ClientPtr client)
             if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
 
             if (isRoot) {
-                int x_off = dixScreenOrigins[j].x;
-                int y_off = dixScreenOrigins[j].y;
+                int x_off = screenInfo.screens[j]->x;
+                int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
                     xPoint *pnts = (xPoint*)&stuff[1];
@@ -1357,8 +1357,8 @@ int PanoramiXPolyLine(ClientPtr client)
             if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
 
             if (isRoot) {
-                int x_off = dixScreenOrigins[j].x;
-                int y_off = dixScreenOrigins[j].y;
+                int x_off = screenInfo.screens[j]->x;
+                int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
 		    xPoint *pnts = (xPoint*)&stuff[1];
@@ -1420,8 +1420,8 @@ int PanoramiXPolySegment(ClientPtr client)
             if(j) memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment));
 
             if (isRoot) {
-                int x_off = dixScreenOrigins[j].x;
-                int y_off = dixScreenOrigins[j].y;
+                int x_off = screenInfo.screens[j]->x;
+                int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
 		    xSegment *segs = (xSegment*)&stuff[1];
@@ -1483,8 +1483,8 @@ int PanoramiXPolyRectangle(ClientPtr client)
             if(j) memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle));
 
 	    if (isRoot) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 
 		if(x_off || y_off) {
@@ -1545,8 +1545,8 @@ int PanoramiXPolyArc(ClientPtr client)
             if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
 
 	    if (isRoot) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 	
 		if(x_off || y_off) {
 		    xArc *arcs = (xArc *) &stuff[1];
@@ -1603,8 +1603,8 @@ int PanoramiXFillPoly(ClientPtr client)
 	    if(j) memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec));
 
 	    if (isRoot) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
 		    DDXPointPtr pnts = (DDXPointPtr)&stuff[1];
@@ -1666,8 +1666,8 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
 	    if(j) memcpy(&stuff[1], origRects, things * sizeof(xRectangle));
 
 	    if (isRoot) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
 		    xRectangle *rects = (xRectangle *) &stuff[1];
@@ -1727,8 +1727,8 @@ int PanoramiXPolyFillArc(ClientPtr client)
 	    if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
 
 	    if (isRoot) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
 		    xArc *arcs = (xArc *) &stuff[1];
@@ -1780,8 +1780,8 @@ int PanoramiXPutImage(ClientPtr client)
     orig_y = stuff->dstY;
     FOR_NSCREENS_BACKWARD(j){
 	if (isRoot) {
-	  stuff->dstX = orig_x - dixScreenOrigins[j].x;
-	  stuff->dstY = orig_y - dixScreenOrigins[j].y;
+	  stuff->dstX = orig_x - screenInfo.screens[j]->x;
+	  stuff->dstY = orig_y - screenInfo.screens[j]->y;
 	}
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
@@ -1846,10 +1846,10 @@ int PanoramiXGetImage(ClientPtr client)
 	    return(BadMatch);
     } else {
       if( /* check for being onscreen */
-	dixScreenOrigins[0].x + pDraw->x + x < 0 ||
-	dixScreenOrigins[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
-	dixScreenOrigins[0].y + pDraw->y + y < 0 ||
-	dixScreenOrigins[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
+	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 ||
 	 /* check for being inside of border */
        	x < - wBorderWidth((WindowPtr)pDraw) ||
 	x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
@@ -1983,8 +1983,8 @@ PanoramiXPolyText8(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - dixScreenOrigins[j].x;
-	    stuff->y = orig_y - dixScreenOrigins[j].y;
+	    stuff->x = orig_x - screenInfo.screens[j]->x;
+	    stuff->y = orig_y - screenInfo.screens[j]->y;
 	}
 	result = (*SavedProcVector[X_PolyText8])(client);
 	if(result != Success) break;
@@ -2024,8 +2024,8 @@ PanoramiXPolyText16(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - dixScreenOrigins[j].x;
-	    stuff->y = orig_y - dixScreenOrigins[j].y;
+	    stuff->x = orig_x - screenInfo.screens[j]->x;
+	    stuff->y = orig_y - screenInfo.screens[j]->y;
 	}
 	result = (*SavedProcVector[X_PolyText16])(client);
 	if(result != Success) break;
@@ -2065,8 +2065,8 @@ int PanoramiXImageText8(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - dixScreenOrigins[j].x;
-	    stuff->y = orig_y - dixScreenOrigins[j].y;
+	    stuff->x = orig_x - screenInfo.screens[j]->x;
+	    stuff->y = orig_y - screenInfo.screens[j]->y;
 	}
 	result = (*SavedProcVector[X_ImageText8])(client);
 	if(result != Success) break;
@@ -2106,8 +2106,8 @@ int PanoramiXImageText16(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - dixScreenOrigins[j].x;
-	    stuff->y = orig_y - dixScreenOrigins[j].y;
+	    stuff->x = orig_x - screenInfo.screens[j]->x;
+	    stuff->y = orig_y - screenInfo.screens[j]->y;
 	}
 	result = (*SavedProcVector[X_ImageText16])(client);
 	if(result != Success) break;
diff --git a/Xext/shm.c b/Xext/shm.c
index 99cd39e..322709c 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -598,8 +598,8 @@ ProcPanoramiXShmPutImage(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->dstX = orig_x - dixScreenOrigins[j].x;
-	    stuff->dstY = orig_y - dixScreenOrigins[j].y;
+	    stuff->dstX = orig_x - screenInfo.screens[j]->x;
+	    stuff->dstY = orig_y - screenInfo.screens[j]->y;
 	}
 	result = ProcShmPutImage(client);
 	if(result != Success) break;
@@ -660,10 +660,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
 	    return(BadMatch);
     } else {
       if( /* check for being onscreen */
-	dixScreenOrigins[0].x + pDraw->x + x < 0 ||
-	dixScreenOrigins[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
-	dixScreenOrigins[0].y + pDraw->y + y < 0 ||
-	dixScreenOrigins[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
+	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 ||
 	 /* 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 efbe973..c63706d 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1690,8 +1690,8 @@ XineramaXvShmPutImage(ClientPtr client)
 	   stuff->drw_x = x;
 	   stuff->drw_y = y;
 	   if(isRoot) {
-		stuff->drw_x -= dixScreenOrigins[i].x;
-		stuff->drw_y -= dixScreenOrigins[i].y;
+		stuff->drw_x -= screenInfo.screens[i]->x;
+		stuff->drw_y -= screenInfo.screens[i]->y;
 	   }
 	   stuff->send_event = (send_event && !i) ? 1 : 0;
 
@@ -1742,8 +1742,8 @@ XineramaXvPutImage(ClientPtr client)
 	   stuff->drw_x = x;
 	   stuff->drw_y = y;
 	   if(isRoot) {
-		stuff->drw_x -= dixScreenOrigins[i].x;
-		stuff->drw_y -= dixScreenOrigins[i].y;
+		stuff->drw_x -= screenInfo.screens[i]->x;
+		stuff->drw_y -= screenInfo.screens[i]->y;
 	   }
 
 	   result = ProcXvPutImage(client);
@@ -1790,8 +1790,8 @@ XineramaXvPutVideo(ClientPtr client)
            stuff->drw_x = x;
            stuff->drw_y = y;
            if(isRoot) {
-                stuff->drw_x -= dixScreenOrigins[i].x;
-                stuff->drw_y -= dixScreenOrigins[i].y;
+                stuff->drw_x -= screenInfo.screens[i]->x;
+                stuff->drw_y -= screenInfo.screens[i]->y;
            }
 
            result = ProcXvPutVideo(client);
@@ -1838,8 +1838,8 @@ XineramaXvPutStill(ClientPtr client)
            stuff->drw_x = x;
            stuff->drw_y = y;
            if(isRoot) {
-                stuff->drw_x -= dixScreenOrigins[i].x;
-                stuff->drw_y -= dixScreenOrigins[i].y;
+                stuff->drw_x -= screenInfo.screens[i]->x;
+                stuff->drw_y -= screenInfo.screens[i]->y;
            }
 
            result = ProcXvPutStill(client);
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index a0c26ba..b521c48 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -43,6 +43,7 @@
 #include "exevents.h"
 #include "exglobals.h"
 #include "eventconvert.h"
+#include "scrnintstr.h"
 #include "xkbsrv.h"
 
 #ifdef PANORAMIX
@@ -181,12 +182,12 @@ ProcXIQueryPointer(ClientPtr client)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-        rep.root_x += FP1616(dixScreenOrigins[0].x, 0);
-        rep.root_y += FP1616(dixScreenOrigins[0].y, 0);
+        rep.root_x += FP1616(screenInfo.screens[0]->x, 0);
+        rep.root_y += FP1616(screenInfo.screens[0]->y, 0);
         if (stuff->win == rep.root)
         {
-            rep.win_x += FP1616(dixScreenOrigins[0].x, 0);
-            rep.win_y += FP1616(dixScreenOrigins[0].y, 0);
+            rep.win_x += FP1616(screenInfo.screens[0]->x, 0);
+            rep.win_y += FP1616(screenInfo.screens[0]->y, 0);
         }
     }
 #endif
diff --git a/dix/events.c b/dix/events.c
index 21ee85e..e8e65e2 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -502,8 +502,8 @@ XineramaSetCursorPosition(
        that screen are. */
 
     pScreen = pSprite->screen;
-    x += dixScreenOrigins[0].x;
-    y += dixScreenOrigins[0].y;
+    x += screenInfo.screens[0]->x;
+    y += screenInfo.screens[0]->y;
 
     if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
 								x, y, &box))
@@ -521,10 +521,10 @@ XineramaSetCursorPosition(
     }
 
     pSprite->screen = pScreen;
-    pSprite->hotPhys.x = x - dixScreenOrigins[0].x;
-    pSprite->hotPhys.y = y - dixScreenOrigins[0].y;
-    x -= dixScreenOrigins[pScreen->myNum].x;
-    y -= dixScreenOrigins[pScreen->myNum].y;
+    pSprite->hotPhys.x = x - screenInfo.screens[0]->x;
+    pSprite->hotPhys.y = y - screenInfo.screens[0]->y;
+    x -= pScreen->x;
+    y -= pScreen->y;
 
     return (*pScreen->SetCursorPosition)(pDev, pScreen, x, y, generateEvent);
 }
@@ -542,10 +542,10 @@ XineramaConstrainCursor(DeviceIntPtr pDev)
 
     /* Translate the constraining box to the screen
        the sprite is actually on */
-    newBox.x1 += dixScreenOrigins[0].x - dixScreenOrigins[pScreen->myNum].x;
-    newBox.x2 += dixScreenOrigins[0].x - dixScreenOrigins[pScreen->myNum].x;
-    newBox.y1 += dixScreenOrigins[0].y - dixScreenOrigins[pScreen->myNum].y;
-    newBox.y2 += dixScreenOrigins[0].y - dixScreenOrigins[pScreen->myNum].y;
+    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;
 
     (* pScreen->ConstrainCursor)(pDev, pScreen, &newBox);
 }
@@ -595,12 +595,12 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
 
     REGION_COPY(pSprite->screen, &pSprite->Reg1,
             &pSprite->windows[i]->borderSize);
-    off_x = dixScreenOrigins[i].x;
-    off_y = dixScreenOrigins[i].y;
+    off_x = screenInfo.screens[i]->x;
+    off_y = screenInfo.screens[i]->y;
 
     while(i--) {
-        x = off_x - dixScreenOrigins[i].x;
-        y = off_y - dixScreenOrigins[i].y;
+        x = off_x - screenInfo.screens[i]->x;
+        y = off_y - screenInfo.screens[i]->y;
 
         if(x || y)
             REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, x, y);
@@ -608,8 +608,8 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
         REGION_UNION(pSprite->screen, &pSprite->Reg1, &pSprite->Reg1,
                 &pSprite->windows[i]->borderSize);
 
-        off_x = dixScreenOrigins[i].x;
-        off_y = dixScreenOrigins[i].y;
+        off_x = screenInfo.screens[i]->x;
+        off_y = screenInfo.screens[i]->y;
     }
 
     pSprite->hotLimits = *REGION_EXTENTS(pSprite->screen, &pSprite->Reg1);
@@ -814,12 +814,12 @@ CheckVirtualMotion(
 
             REGION_COPY(pSprite->screen, &pSprite->Reg2,
                     &pSprite->windows[i]->borderSize);
-            off_x = dixScreenOrigins[i].x;
-            off_y = dixScreenOrigins[i].y;
+            off_x = screenInfo.screens[i]->x;
+            off_y = screenInfo.screens[i]->y;
 
             while(i--) {
-                x = off_x - dixScreenOrigins[i].x;
-                y = off_y - dixScreenOrigins[i].y;
+                x = off_x - screenInfo.screens[i]->x;
+                y = off_y - screenInfo.screens[i]->y;
 
                 if(x || y)
                     REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, x, y);
@@ -827,8 +827,8 @@ CheckVirtualMotion(
                 REGION_UNION(pSprite->screen, &pSprite->Reg2, &pSprite->Reg2,
                         &pSprite->windows[i]->borderSize);
 
-                off_x = dixScreenOrigins[i].x;
-                off_y = dixScreenOrigins[i].y;
+                off_x = screenInfo.screens[i]->x;
+                off_y = screenInfo.screens[i]->y;
             }
         } else
 #endif
@@ -1135,10 +1135,8 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
     {
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension) {
-	    event->root_x += dixScreenOrigins[pSprite->screen->myNum].x -
-			      dixScreenOrigins[0].x;
-	    event->root_y += dixScreenOrigins[pSprite->screen->myNum].y -
-			      dixScreenOrigins[0].y;
+	    event->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
+	    event->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
 	}
 #endif
 	pSprite->hotPhys.x = event->root_x;
@@ -1218,10 +1216,10 @@ PlayReleasedEvents(void)
                     case ET_KeyRelease:
                     case ET_ProximityIn:
                     case ET_ProximityOut:
-                        ev->root_x += dixScreenOrigins[0].x -
-                            dixScreenOrigins[pDev->spriteInfo->sprite->screen->myNum].x;
-                        ev->root_y += dixScreenOrigins[0].y -
-                            dixScreenOrigins[pDev->spriteInfo->sprite->screen->myNum].y;
+                        ev->root_x += screenInfo.screens[0]->x -
+                            pDev->spriteInfo->sprite->screen->x;
+                        ev->root_y += screenInfo.screens[0]->y -
+                            pDev->spriteInfo->sprite->screen->y;
                         break;
                     default:
                         break;
@@ -2561,8 +2559,8 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
 	for(i = 1; i < PanoramiXNumScreens; i++) {
 	   if(POINT_IN_REGION(pSprite->screen,
 			&pSprite->windows[i]->borderSize,
-			x + dixScreenOrigins[0].x - dixScreenOrigins[i].x,
-			y + dixScreenOrigins[0].y - dixScreenOrigins[i].y,
+			x + screenInfo.screens[0]->x - screenInfo.screens[i]->x,
+			y + screenInfo.screens[0]->y - screenInfo.screens[i]->y,
 			&box))
 		return TRUE;
 	}
@@ -2757,10 +2755,8 @@ 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 += dixScreenOrigins[pSprite->screen->myNum].x -
-                                       dixScreenOrigins[0].x;
-            ev->root_y += dixScreenOrigins[pSprite->screen->myNum].y -
-                                       dixScreenOrigins[0].y;
+            ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
+            ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
         } else
 #endif
         {
@@ -3008,10 +3004,10 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
     }
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-        pSprite->hotLimits.x1 = -dixScreenOrigins[0].x;
-        pSprite->hotLimits.y1 = -dixScreenOrigins[0].y;
-        pSprite->hotLimits.x2 = PanoramiXPixWidth  - dixScreenOrigins[0].x;
-        pSprite->hotLimits.y2 = PanoramiXPixHeight - dixScreenOrigins[0].y;
+        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;
         pSprite->physLimits = pSprite->hotLimits;
         pSprite->confineWin = NullWindow;
         pSprite->hotShape = NullRegion;
@@ -3078,10 +3074,10 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-        pSprite->hotLimits.x1 = -dixScreenOrigins[0].x;
-        pSprite->hotLimits.y1 = -dixScreenOrigins[0].y;
-        pSprite->hotLimits.x2 = PanoramiXPixWidth  - dixScreenOrigins[0].x;
-        pSprite->hotLimits.y2 = PanoramiXPixHeight - dixScreenOrigins[0].y;
+        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;
         pSprite->physLimits = pSprite->hotLimits;
         pSprite->screen = pScreen;
     }
@@ -3114,10 +3110,8 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
     pSprite->hotPhys.y = y;
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-	pSprite->hotPhys.x += dixScreenOrigins[newScreen->myNum].x -
-			    dixScreenOrigins[0].x;
-	pSprite->hotPhys.y += dixScreenOrigins[newScreen->myNum].y -
-			    dixScreenOrigins[0].y;
+	pSprite->hotPhys.x += newScreen->x - screenInfo.screens[0]->x;
+	pSprite->hotPhys.y += newScreen->y - screenInfo.screens[0]->y;
 	if (newScreen != pSprite->screen) {
 	    pSprite->screen = newScreen;
 	    /* Make sure we tell the DDX to update its copy of the screen */
@@ -3132,10 +3126,10 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
 		(*pSprite->screen->SetCursorPosition)(
                                                       pDev,
                                                       pSprite->screen,
-		    pSprite->hotPhys.x + dixScreenOrigins[0].x -
-			dixScreenOrigins[pSprite->screen->myNum].x,
-		    pSprite->hotPhys.y + dixScreenOrigins[0].y -
-			dixScreenOrigins[pSprite->screen->myNum].y, FALSE);
+		    pSprite->hotPhys.x + screenInfo.screens[0]->x -
+			pSprite->screen->x,
+		    pSprite->hotPhys.y + screenInfo.screens[0]->y -
+			pSprite->screen->y, FALSE);
 	}
     } else
 #endif
@@ -3163,14 +3157,14 @@ XineramaPointInWindowIsVisible(
 
     if(!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE;
 
-    xoff = x + dixScreenOrigins[0].x;
-    yoff = y + dixScreenOrigins[0].y;
+    xoff = x + screenInfo.screens[0]->x;
+    yoff = y + screenInfo.screens[0]->y;
 
     for(i = 1; i < PanoramiXNumScreens; i++) {
 	pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
 	pScreen = pWin->drawable.pScreen;
-	x = xoff - dixScreenOrigins[i].x;
-	y = yoff - dixScreenOrigins[i].y;
+	x = xoff - screenInfo.screens[i]->x;
+	y = yoff - screenInfo.screens[i]->y;
 
 	if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)
 	   && (!wInputShape(pWin) ||
@@ -3216,8 +3210,8 @@ XineramaWarpPointer(ClientPtr client)
 	winX = source->drawable.x;
 	winY = source->drawable.y;
 	if(source == screenInfo.screens[0]->root) {
-	    winX -= dixScreenOrigins[0].x;
-	    winY -= dixScreenOrigins[0].y;
+	    winX -= screenInfo.screens[0]->x;
+	    winY -= screenInfo.screens[0]->y;
 	}
 	if (x < winX + stuff->srcX ||
 	    y < winY + stuff->srcY ||
@@ -3232,8 +3226,8 @@ XineramaWarpPointer(ClientPtr client)
 	x = dest->drawable.x;
 	y = dest->drawable.y;
 	if(dest == screenInfo.screens[0]->root) {
-	    x -= dixScreenOrigins[0].x;
-	    y -= dixScreenOrigins[0].y;
+	    x -= screenInfo.screens[0]->x;
+	    y -= screenInfo.screens[0]->y;
 	}
     }
 
@@ -4997,11 +4991,11 @@ ProcQueryPointer(ClientPtr client)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-	rep.rootX += dixScreenOrigins[0].x;
-	rep.rootY += dixScreenOrigins[0].y;
+	rep.rootX += screenInfo.screens[0]->x;
+	rep.rootY += screenInfo.screens[0]->y;
 	if(stuff->id == rep.root) {
-	    rep.winX += dixScreenOrigins[0].x;
-	    rep.winY += dixScreenOrigins[0].y;
+	    rep.winX += screenInfo.screens[0]->x;
+	    rep.winY += screenInfo.screens[0]->y;
 	}
     }
 #endif
@@ -5670,7 +5664,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension &&
-       (dixScreenOrigins[0].x || dixScreenOrigins[0].y))
+       (screenInfo.screens[0]->x || screenInfo.screens[0]->y))
     {
 	switch(events->u.u.type) {
 	case MotionNotify:
@@ -5687,13 +5681,13 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
         */
 	    count = 1;  /* should always be 1 */
 	    memcpy(&eventCopy, events, sizeof(xEvent));
-	    eventCopy.u.keyButtonPointer.rootX += dixScreenOrigins[0].x;
-	    eventCopy.u.keyButtonPointer.rootY += dixScreenOrigins[0].y;
+	    eventCopy.u.keyButtonPointer.rootX += screenInfo.screens[0]->x;
+	    eventCopy.u.keyButtonPointer.rootY += screenInfo.screens[0]->y;
 	    if(eventCopy.u.keyButtonPointer.event ==
 	       eventCopy.u.keyButtonPointer.root)
 	    {
-		eventCopy.u.keyButtonPointer.eventX += dixScreenOrigins[0].x;
-		eventCopy.u.keyButtonPointer.eventY += dixScreenOrigins[0].y;
+		eventCopy.u.keyButtonPointer.eventX += screenInfo.screens[0]->x;
+		eventCopy.u.keyButtonPointer.eventY += screenInfo.screens[0]->y;
 	    }
 	    events = &eventCopy;
 	    break;
diff --git a/dix/getevents.c b/dix/getevents.c
index 3ca5883..3892f6f 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1210,8 +1210,8 @@ PostSyntheticMotion(DeviceIntPtr pDev,
        will translate from sprite screen to screen 0 upon reentry
        to the DIX layer. */
     if (!noPanoramiXExtension) {
-        x += dixScreenOrigins[0].x - dixScreenOrigins[screen].x;
-        y += dixScreenOrigins[0].y - dixScreenOrigins[screen].y;
+        x += screenInfo.screens[0]->x - screenInfo.screens[screen]->x;
+        y += screenInfo.screens[0]->y - screenInfo.screens[screen]->y;
     }
 #endif
 
diff --git a/dix/globals.c b/dix/globals.c
index 28e7d07..82a85c2 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -135,5 +135,3 @@ char *display;
 char *ConnectionInfo;
 
 CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
-
-DDXPointRec dixScreenOrigins[MAXSCREENS];
diff --git a/dix/window.c b/dix/window.c
index 8345523..9e1f491 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2236,8 +2236,8 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 	event.u.configureRequest.y = y;
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension && (!pParent || !pParent->parent)) {
-            event.u.configureRequest.x += dixScreenOrigins[0].x;
-            event.u.configureRequest.y += dixScreenOrigins[0].y;
+            event.u.configureRequest.x += screenInfo.screens[0]->x;
+            event.u.configureRequest.y += screenInfo.screens[0]->y;
 	}
 #endif
 	event.u.configureRequest.width = w;
@@ -2317,8 +2317,8 @@ ActuallyDoSomething:
 	event.u.configureNotify.y = y;
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension && (!pParent || !pParent->parent)) {
-	    event.u.configureNotify.x += dixScreenOrigins[0].x;
-	    event.u.configureNotify.y += dixScreenOrigins[0].y;
+	    event.u.configureNotify.x += screenInfo.screens[0]->x;
+	    event.u.configureNotify.y += screenInfo.screens[0]->y;
 	}
 #endif
 	event.u.configureNotify.width = w;
@@ -2471,8 +2471,8 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
     event.u.reparent.y = y;
 #ifdef PANORAMIX
     if(!noPanoramiXExtension && !pParent->parent) {
-	event.u.reparent.x += dixScreenOrigins[0].x;
-	event.u.reparent.y += dixScreenOrigins[0].y;
+	event.u.reparent.x += screenInfo.screens[0]->x;
+	event.u.reparent.y += screenInfo.screens[0]->y;
     }
 #endif
     event.u.reparent.override = pWin->overrideRedirect;
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index bf5640d..7e03686 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -230,7 +230,7 @@ static int dmxSLFindNext(int *list)
 /** Make one pass over all the screens and return the number updated. */
 static int dmxTryComputeScreenOrigins(int *screensLeft)
 {
-    ScreenPtr       pScreen;
+    ScreenPtr       pScreen, refScreen;
     DMXScreenInfo   *screen;
     int             i, ref;
     int             changed = 0;
@@ -239,54 +239,56 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
         if (!screensLeft[i])
             continue;
         screen  = &dmxScreens[i];
+        pScreen = screenInfo.screens[i];
         switch (screen->where) {
         case PosAbsolute:
-            dixScreenOrigins[i].x = screen->whereX;
-            dixScreenOrigins[i].y = screen->whereY;
+            pScreen->x = screen->whereX;
+            pScreen->y = screen->whereY;
             ++changed, screensLeft[i] = 0;
             break;
         case PosRelative:
             ref = screen->whereRefScreen;
             if (screensLeft[ref])
                 break;
-            dixScreenOrigins[i].x = dixScreenOrigins[ref].x + screen->whereX;
-            dixScreenOrigins[i].y = dixScreenOrigins[ref].y + screen->whereY;
+            refScreen = screenInfo.screens[ref];
+            pScreen->x = refScreen->x + screen->whereX;
+            pScreen->y = refScreen->y + screen->whereY;
             ++changed, screensLeft[i] = 0;
             break;
         case PosRightOf:
             ref = screen->whereRefScreen;
             if (screensLeft[ref])
                 break;
-            pScreen = screenInfo.screens[ref];
-            dixScreenOrigins[i].x = dixScreenOrigins[ref].x + pScreen->width;
-            dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
+            refScreen = screenInfo.screens[ref];
+            pScreen->x = refScreen->x + refScreen->width;
+            pScreen->y = refScreen->y;
             ++changed, screensLeft[i] = 0;
             break;
         case PosLeftOf:
             ref = screen->whereRefScreen;
             if (screensLeft[ref])
                 break;
-            pScreen = screenInfo.screens[i];
-            dixScreenOrigins[i].x = dixScreenOrigins[ref].x - pScreen->width;
-            dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
+            refScreen = screenInfo.screens[ref];
+            pScreen->x = refScreen->x - pScreen->width;
+            pScreen->y = refScreen->y;
             ++changed, screensLeft[i] = 0;
             break;
         case PosBelow:
             ref = screen->whereRefScreen;
             if (screensLeft[ref])
                 break;
-            pScreen = screenInfo.screens[ref];
-            dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
-            dixScreenOrigins[i].y = dixScreenOrigins[ref].y + pScreen->height;
+            refScreen = screenInfo.screens[ref];
+            pScreen->x = refScreen->x;
+            pScreen->y = refScreen->y + refScreen->height;
             ++changed, screensLeft[i] = 0;
             break;
         case PosAbove:
             ref = screen->whereRefScreen;
             if (screensLeft[ref])
                 break;
-            pScreen = screenInfo.screens[i];
-            dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
-            dixScreenOrigins[i].y = dixScreenOrigins[ref].y - pScreen->height;
+            refScreen = screenInfo.screens[ref];
+            pScreen->x = refScreen->x;
+            pScreen->y = refScreen->y - pScreen->height;
             ++changed, screensLeft[i] = 0;
             break;
         case PosNone:
@@ -298,6 +300,7 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
 
 static void dmxComputeScreenOrigins(void)
 {
+    ScreenPtr       pScreen;
     int             *screensLeft;
     int             i, ref;
     int             minX, minY;
@@ -313,8 +316,9 @@ static void dmxComputeScreenOrigins(void)
 	     * guarantees that we will eventually terminate.
 	     */
 	    ref                     = dmxScreens[i].whereRefScreen;
-	    dixScreenOrigins[ref].x = dixScreenOrigins[ref].y = 0;
-            screensLeft[ref]        = 0;
+	    pScreen                 = screenInfo.screens[ref];
+	    pScreen->x = pScreen->y = 0;
+	    screensLeft[ref]        = 0;
 	}
     }
     dmxSLFree(screensLeft);
@@ -322,18 +326,18 @@ static void dmxComputeScreenOrigins(void)
 
                                 /* Justify the topmost and leftmost to
                                  * (0,0). */
-    minX = dixScreenOrigins[0].x;
-    minY = dixScreenOrigins[0].y;
+    minX = screenInfo.screens[0]->x;
+    minY = screenInfo.screens[0]->y;
     for (i = 1; i < dmxNumScreens; i++) { /* Compute minX, minY */
-	if (dixScreenOrigins[i].x < minX)
-            minX = dixScreenOrigins[i].x;
-	if (dixScreenOrigins[i].y < minY)
-            minY = dixScreenOrigins[i].y;
+	if (screenInfo.screens[i]->x < minX)
+            minX = screenInfo.screens[i]->x;
+	if (screenInfo.screens[i]->y < minY)
+            minY = screenInfo.screens[i]->y;
     }
     if (minX || minY) {
 	for (i = 0; i < dmxNumScreens; i++) {
-	    dixScreenOrigins[i].x -= minX;
-	    dixScreenOrigins[i].y -= minY;
+	    screenInfo.screens[i]->x -= minX;
+	    screenInfo.screens[i]->y -= minY;
 	}
     }
 }
@@ -398,8 +402,8 @@ void dmxInitOrigins(void)
 
     for (i = 0; i < dmxNumScreens; i++) {
         DMXScreenInfo  *dmxScreen = &dmxScreens[i];
-        dmxScreen->rootXOrigin = dixScreenOrigins[i].x;
-        dmxScreen->rootYOrigin = dixScreenOrigins[i].y;
+        dmxScreen->rootXOrigin = screenInfo.screens[i]->x;
+        dmxScreen->rootYOrigin = screenInfo.screens[i]->y;
     }
 
     dmxReInitOrigins();
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index 678f290..5945a5e 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -447,12 +447,12 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y)
     dmxScreen->rootYOrigin = y;
 
     /* Compute offsets here in case <x,y> has been changed above */
-    xoff = x - dixScreenOrigins[idx].x;
-    yoff = y - dixScreenOrigins[idx].y;
+    xoff = x - pScreen->x;
+    yoff = y - pScreen->y;
 
-    /* Adjust the root window's position in dixScreenOrigins */
-    dixScreenOrigins[idx].x = dmxScreen->rootXOrigin;
-    dixScreenOrigins[idx].y = dmxScreen->rootYOrigin;
+    /* Adjust the root window's position */
+    pScreen->x = dmxScreen->rootXOrigin;
+    pScreen->y = dmxScreen->rootYOrigin;
 
     /* Recalculate the Xinerama regions and data structs */
     XineramaReinitData(pScreen);
diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml
index 251e6ac..d0c83bb 100644
--- a/hw/dmx/doc/dmx.xml
+++ b/hw/dmx/doc/dmx.xml
@@ -1511,8 +1511,7 @@ PanoramiX prefix.
     physical screen, and single region (PanoramiXScreenRegion) is
     initialized to be the union of the screen regions.
     The relative positioning information for the
-    physical screens is taken from the array
-    dixScreenOrigins&lsqb;&rsqb;, which
+    physical screens is taken from the ScreenRec x and y members, which
     the DDX layer must initialize in InitOutput().  The bounds of the
     combined screen is also calculated (PanoramiXPixWidth and
     PanoramiXPixHeight).
diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c
index 2f23d1c..c665dad 100644
--- a/hw/dmx/input/dmxcommon.c
+++ b/hw/dmx/input/dmxcommon.c
@@ -526,10 +526,9 @@ int dmxFindPointerScreen(int x, int y)
     int i;
 
     for (i = 0; i < dmxNumScreens; i++) {
-	if (x >= dixScreenOrigins[i].x
-            && x < dixScreenOrigins[i].x + screenInfo.screens[i]->width
-            && y >= dixScreenOrigins[i].y
-            && y < dixScreenOrigins[i].y + screenInfo.screens[i]->height)
+	ScreenPtr pScreen = screenInfo.screens[i];
+	if (x >= pScreen->x && x < pScreen->x + pScreen->width &&
+	    y >= pScreen->y && y < pScreen->y + pScreen->height)
 	    return i;
     }
     return -1;
diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c
index bf34169..297166e 100644
--- a/hw/dmx/input/dmxconsole.c
+++ b/hw/dmx/input/dmxconsole.c
@@ -204,7 +204,8 @@ static void dmxConsoleDrawWindows(pointer private)
     XUnionRectWithRegion(&rect, whole, whole);
     
     for (i = 0; i < dmxNumScreens; i++) {
-        WindowPtr     pRoot       = screenInfo.screens[i]->root;
+        ScreenPtr     pScreen     = screenInfo.screens[i];
+        WindowPtr     pRoot       = pScreen->root;
         WindowPtr     pChild;
 
 #if DMX_WINDOW_DEBUG
@@ -227,10 +228,8 @@ static void dmxConsoleDrawWindows(pointer private)
                        pChild->overrideRedirect,
                        REGION_NUM_RECTS(&pChild->clipList));
 #endif
-                rect.x      = scalex(priv, pChild->drawable.x
-                                     + dixScreenOrigins[i].x);
-                rect.y      = scaley(priv, pChild->drawable.y
-                                     + dixScreenOrigins[i].y);
+                rect.x      = scalex(priv, pChild->drawable.x + pScreen->x);
+                rect.y      = scaley(priv, pChild->drawable.y + pScreen->y);
                 rect.width  = scalex(priv, pChild->drawable.width);
                 rect.height = scaley(priv, pChild->drawable.height);
                 XDrawRectangle(dpy, priv->pixmap, priv->gc,
@@ -263,15 +262,15 @@ static void dmxConsoleDraw(myPrivate *priv, int updateCursor, int update)
         DMXScreenInfo *dmxScreen = &dmxScreens[i];
 	XFillRectangle(dpy, priv->pixmap,
                        dmxScreen->beDisplay ? priv->gcRev : priv->gcDet,
-                       scalex(priv, dixScreenOrigins[i].x),
-                       scaley(priv, dixScreenOrigins[i].y),
+                       scalex(priv, screenInfo.screens[i]->x),
+                       scaley(priv, screenInfo.screens[i]->y),
                        scalex(priv, screenInfo.screens[i]->width),
                        scaley(priv, screenInfo.screens[i]->height));
     }
     for (i = 0; i < dmxNumScreens; i++) {
         XDrawRectangle(dpy, priv->pixmap, priv->gc,
-                       scalex(priv, dixScreenOrigins[i].x),
-                       scaley(priv, dixScreenOrigins[i].y),
+                       scalex(priv, screenInfo.screens[i]->x),
+                       scaley(priv, screenInfo.screens[i]->y),
                        scalex(priv, screenInfo.screens[i]->width),
                        scaley(priv, screenInfo.screens[i]->height));
     }
@@ -671,11 +670,11 @@ static void dmxConsoleComputeWidthHeight(myPrivate *priv,
                                  * possible by computing the visible
                                  * bounding box. */
     for (i = 0; i < dmxNumScreens; i++) {
-	if (dixScreenOrigins[i].x+screenInfo.screens[i]->width > *width)
-	    *width = dixScreenOrigins[i].x+screenInfo.screens[i]->width;
+	if (screenInfo.screens[i]->x+screenInfo.screens[i]->width > *width)
+	    *width = screenInfo.screens[i]->x+screenInfo.screens[i]->width;
         
-	if (dixScreenOrigins[i].y+screenInfo.screens[i]->height > *height)
-	    *height = dixScreenOrigins[i].y+screenInfo.screens[i]->height;
+	if (screenInfo.screens[i]->y+screenInfo.screens[i]->height > *height)
+	    *height = screenInfo.screens[i]->y+screenInfo.screens[i]->height;
     }
 #endif
 
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 10df02d..7993f9b 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -941,9 +941,8 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
     pScreenPriv->card = card;
     pScreenPriv->bytesPerPixel = screen->fb.bitsPerPixel >> 3;
     pScreenPriv->dpmsState = KD_DPMS_NORMAL;
-#ifdef PANORAMIX
-    dixScreenOrigins[pScreen->myNum] = screen->origin;
-#endif
+    pScreen->x = screen->origin.x;
+    pScreen->y = screen->origin.y;
 
     if (!monitorResolution)
 	monitorResolution = 75;
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 9cde059..714743a 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -581,7 +581,7 @@ xf86InitOrigins(void)
 {
     unsigned long screensLeft, prevScreensLeft, mask;
     screenLayoutPtr screen;
-    ScreenPtr pScreen;
+    ScreenPtr pScreen, refScreen;
     int x1, x2, y1, y2, left, right, top, bottom;
     int i, j, ref, minX, minY, min, max;
     xf86ScreenLayoutPtr pLayout;
@@ -608,6 +608,7 @@ xf86InitOrigins(void)
 	        continue;
 	    }
 
+	    pScreen = xf86Screens[i]->pScreen;
 	    switch(screen->where) {
 	    case PosObsolete:
 		OldStyleConfig = TRUE;
@@ -620,7 +621,7 @@ xf86InitOrigins(void)
 			break;
 		    }
 		    pLayout->left = AddEdge(pLayout->left, 
-			0, xf86Screens[i]->pScreen->height,
+			0, pScreen->height,
 			xf86Screens[ref]->pScreen->width, 0, ref);
 		}
 		if(screen->right) {
@@ -629,7 +630,6 @@ xf86InitOrigins(void)
 			ErrorF("Referenced uninitialized screen in Layout!\n");
 			break;
 		    }
-		    pScreen = xf86Screens[i]->pScreen;
 		    pLayout->right = AddEdge(pLayout->right, 
 			0, pScreen->height, -pScreen->width, 0, ref);
 		}
@@ -640,7 +640,7 @@ xf86InitOrigins(void)
 			break;
 		    }
 		    pLayout->up = AddEdge(pLayout->up, 
-			0, xf86Screens[i]->pScreen->width,
+			0, pScreen->width,
 			0, xf86Screens[ref]->pScreen->height, ref);
 		}
 		if(screen->bottom) {
@@ -649,7 +649,6 @@ xf86InitOrigins(void)
 			ErrorF("Referenced uninitialized screen in Layout!\n");
 			break;
 		    }
-		    pScreen = xf86Screens[i]->pScreen;
 		    pLayout->down = AddEdge(pLayout->down, 
 			0, pScreen->width, 0, -pScreen->height, ref);
 		}
@@ -658,8 +657,8 @@ xf86InitOrigins(void)
 		screen->x = screen->y = 0;
 		/* FALLTHROUGH */
 	    case PosAbsolute:
-		dixScreenOrigins[i].x = screen->x;
-		dixScreenOrigins[i].y = screen->y;
+		pScreen->x = screen->x;
+		pScreen->y = screen->y;
 		screensLeft &= ~(1 << i);
 		break;
 	    case PosRelative:
@@ -669,8 +668,9 @@ xf86InitOrigins(void)
 		    break;
 		}
 		if(screensLeft & (1 << ref)) break;
-		dixScreenOrigins[i].x = dixScreenOrigins[ref].x + screen->x;
-		dixScreenOrigins[i].y = dixScreenOrigins[ref].y + screen->y;
+		refScreen = xf86Screens[ref]->pScreen;
+		pScreen->x = refScreen->x + screen->x;
+		pScreen->y = refScreen->y + screen->y;
 		screensLeft &= ~(1 << i);
 		break;
 	    case PosRightOf:
@@ -680,10 +680,9 @@ xf86InitOrigins(void)
 		    break;
 		}
 		if(screensLeft & (1 << ref)) break;
-		pScreen = xf86Screens[ref]->pScreen;
-		dixScreenOrigins[i].x = 
-			dixScreenOrigins[ref].x + pScreen->width;
-		dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
+		refScreen = xf86Screens[ref]->pScreen;
+		pScreen->x = refScreen->x + refScreen->width;
+		pScreen->y = refScreen->y;
 		screensLeft &= ~(1 << i);
 		break;
 	    case PosLeftOf:
@@ -693,10 +692,9 @@ xf86InitOrigins(void)
 		    break;
 		}
 		if(screensLeft & (1 << ref)) break;
-		pScreen = xf86Screens[i]->pScreen;
-		dixScreenOrigins[i].x = 
-			dixScreenOrigins[ref].x - pScreen->width;
-		dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
+		refScreen = xf86Screens[ref]->pScreen;
+		pScreen->x = refScreen->x - pScreen->width;
+		pScreen->y = refScreen->y;
 		screensLeft &= ~(1 << i);
 		break;
 	    case PosBelow:
@@ -706,10 +704,9 @@ xf86InitOrigins(void)
 		    break;
 		}
 		if(screensLeft & (1 << ref)) break;
-		pScreen = xf86Screens[ref]->pScreen;
-		dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
-		dixScreenOrigins[i].y = 
-			dixScreenOrigins[ref].y + pScreen->height;
+		refScreen = xf86Screens[ref]->pScreen;
+		pScreen->x = refScreen->x;
+		pScreen->y = refScreen->y + refScreen->height;
 		screensLeft &= ~(1 << i);
 		break;
 	    case PosAbove:
@@ -719,10 +716,9 @@ xf86InitOrigins(void)
 		    break;
 		}
 		if(screensLeft & (1 << ref)) break;
-		pScreen = xf86Screens[i]->pScreen;
-		dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
-		dixScreenOrigins[i].y = 
-			dixScreenOrigins[ref].y - pScreen->height;
+		refScreen = xf86Screens[ref]->pScreen;
+		pScreen->x = refScreen->x;
+		pScreen->y = refScreen->y - pScreen->height;
 		screensLeft &= ~(1 << i);
 		break;
 	    default:
@@ -741,7 +737,7 @@ xf86InitOrigins(void)
 	    while(!((1 << i) & screensLeft)){ i++; }
 
 	    ref = xf86ConfigLayout.screens[i].refscreen->screennum;
-	    dixScreenOrigins[ref].x = dixScreenOrigins[ref].y = 0;
+	    xf86Screens[ref]->pScreen->x = xf86Screens[ref]->pScreen->y = 0;
 	    screensLeft &= ~(1 << ref);
 	}
 
@@ -749,20 +745,20 @@ xf86InitOrigins(void)
     }
 
     /* justify the topmost and leftmost to (0,0) */
-    minX = dixScreenOrigins[0].x;
-    minY = dixScreenOrigins[0].y;
+    minX = xf86Screens[0]->pScreen->x;
+    minY = xf86Screens[0]->pScreen->y;
 
     for(i = 1; i < xf86NumScreens; i++) {
-	if(dixScreenOrigins[i].x < minX)
-	  minX = dixScreenOrigins[i].x;
-	if(dixScreenOrigins[i].y < minY)
-	  minY = dixScreenOrigins[i].y;
+	if(xf86Screens[i]->pScreen->x < minX)
+	  minX = xf86Screens[i]->pScreen->x;
+	if(xf86Screens[i]->pScreen->y < minY)
+	  minY = xf86Screens[i]->pScreen->y;
     }
 
     if (minX || minY) {
 	for(i = 0; i < xf86NumScreens; i++) {
-	   dixScreenOrigins[i].x -= minX;
-	   dixScreenOrigins[i].y -= minY;
+	   xf86Screens[i]->pScreen->x -= minX;
+	   xf86Screens[i]->pScreen->y -= minY;
 	}
     }
 
@@ -775,18 +771,20 @@ xf86InitOrigins(void)
 
 	pScreen = xf86Screens[i]->pScreen;
 
-	left = dixScreenOrigins[i].x;
+	left = pScreen->x;
 	right = left + pScreen->width;
-	top = dixScreenOrigins[i].y;
+	top = pScreen->y;
 	bottom = top + pScreen->height;
 
 	for(j = 0; j < xf86NumScreens; j++) {
 	    if(i == j) continue;
 
-	    x1 = dixScreenOrigins[j].x;
-	    x2 = x1 + xf86Screens[j]->pScreen->width;
-	    y1 = dixScreenOrigins[j].y;
-	    y2 = y1 + xf86Screens[j]->pScreen->height;
+	    refScreen = xf86Screens[j]->pScreen;
+
+	    x1 = refScreen->x;
+	    x2 = x1 + refScreen->width;
+	    y1 = refScreen->y;
+	    y2 = y1 + refScreen->height;
 
 	    if((bottom > y1) && (top < y2)) {
 		min = y1 - top;
@@ -796,13 +794,13 @@ xf86InitOrigins(void)
 
 		if(((left - 1) >= x1) && ((left - 1) < x2))
 		    pLayout->left = AddEdge(pLayout->left, min, max,
-			dixScreenOrigins[i].x - dixScreenOrigins[j].x,
-			dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
+			pScreen->x - refScreen->x,
+			pScreen->y - refScreen->y, j);
 
 		if((right >= x1) && (right < x2))	
 		    pLayout->right = AddEdge(pLayout->right, min, max,
-			dixScreenOrigins[i].x - dixScreenOrigins[j].x,
-			dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
+			pScreen->x - refScreen->x,
+			pScreen->y - refScreen->y, j);
 	    }
 
 
@@ -814,13 +812,13 @@ xf86InitOrigins(void)
 
 		if(((top - 1) >= y1) && ((top - 1) < y2))
 		    pLayout->up = AddEdge(pLayout->up, min, max,
-			dixScreenOrigins[i].x - dixScreenOrigins[j].x,
-			dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
+			pScreen->x - refScreen->x,
+			pScreen->y - refScreen->y, j);
 
 		if((bottom >= y1) && (bottom < y2))
 		    pLayout->down = AddEdge(pLayout->down, min, max,
-			dixScreenOrigins[i].x - dixScreenOrigins[j].x,
-			dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
+			pScreen->x - refScreen->x,
+			pScreen->y - refScreen->y, j);
 	    }
 	}
       }
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 0845f67..1c77ad9 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -140,10 +140,8 @@ AppleWMSetScreenOrigin(
 {
     int32_t data[2];
 
-    data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
-                + darwinMainScreenX);
-    data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
-                + darwinMainScreenY);
+    data[0] = pWin->drawable.pScreen->x + darwinMainScreenX;
+    data[1] = pWin->drawable.pScreen->y + darwinMainScreenY;
 
     dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
 			    XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 825afa0..7453ecc 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -262,8 +262,8 @@ static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv
         return FALSE;
     }
 
-    dixScreenOrigins[index].x = dfb->x;
-    dixScreenOrigins[index].y = dfb->y;
+    pScreen->x = dfb->x;
+    pScreen->y = dfb->y;
 
     /*    ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
 	  index, dfb->width, dfb->height, dfb->x, dfb->y); */
@@ -526,16 +526,16 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
 {
     int i, left, top;
 
-    left = dixScreenOrigins[0].x;
-    top  = dixScreenOrigins[0].y;
+    left = pScreenInfo->screens[0]->x;
+    top  = pScreenInfo->screens[0]->y;
 
     /* Find leftmost screen. If there's a tie, take the topmost of the two. */
     for (i = 1; i < pScreenInfo->numScreens; i++) {
-        if (dixScreenOrigins[i].x < left  ||
-            (dixScreenOrigins[i].x == left && dixScreenOrigins[i].y < top))
+        if (pScreenInfo->screens[i]->x < left  ||
+            (pScreenInfo->screens[i]->x == left && pScreenInfo->screens[i]->y < top))
         {
-            left = dixScreenOrigins[i].x;
-            top = dixScreenOrigins[i].y;
+            left = pScreenInfo->screens[i]->x;
+            top = pScreenInfo->screens[i]->y;
         }
     }
 
@@ -551,10 +551,10 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
 
     if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
         for (i = 0; i < pScreenInfo->numScreens; i++) {
-            dixScreenOrigins[i].x -= darwinMainScreenX;
-            dixScreenOrigins[i].y -= darwinMainScreenY;
+            pScreenInfo->screens[i]->x -= darwinMainScreenX;
+            pScreenInfo->screens[i]->y -= darwinMainScreenY;
             DEBUG_LOG("Screen %d placed at X11 coordinate (%d,%d).\n",
-                      i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
+                      i, pScreenInfo->screens[i]->x, pScreenInfo->screens[i]->y);
         }
     }
 }
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 421efce..147b32a 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -377,8 +377,8 @@ static void DarwinPrepareValuators(DeviceIntPtr pDev, int *valuators, ScreenPtr
                                    float pointer_x, float pointer_y, 
                                    float pressure, float tilt_x, float tilt_y) {
     /* Fix offset between darwin and X screens */
-    pointer_x -= darwinMainScreenX + dixScreenOrigins[screen->myNum].x;
-    pointer_y -= darwinMainScreenY + dixScreenOrigins[screen->myNum].y;
+    pointer_x -= darwinMainScreenX + screen->x;
+    pointer_y -= darwinMainScreenY + screen->y;
 
     if(pointer_x < 0.0)
         pointer_x = 0.0;
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index ac7fedd..bb37e4a 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -259,8 +259,8 @@ void QuartzUpdateScreens(void) {
     PseudoramiXResetScreens();
     quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height);
     
-    dixScreenOrigins[pScreen->myNum].x = x;
-    dixScreenOrigins[pScreen->myNum].y = y;
+    pScreen->x = x;
+    pScreen->y = y;
     pScreen->mmWidth = pScreen->mmWidth * ((double) width / pScreen->width);
     pScreen->mmHeight = pScreen->mmHeight * ((double) height / pScreen->height);
     pScreen->width = width;
@@ -269,11 +269,11 @@ void QuartzUpdateScreens(void) {
     DarwinAdjustScreenOrigins(&screenInfo);
     quartzProcs->UpdateScreen(pScreen);
     
-    /* DarwinAdjustScreenOrigins or UpdateScreen may change dixScreenOrigins,
+    /* DarwinAdjustScreenOrigins or UpdateScreen may change pScreen->x/y,
      * so use it rather than x/y
      */
-    sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
-    sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+    sx = pScreen->x + darwinMainScreenX;
+    sy = pScreen->y + darwinMainScreenY;
     
     /* Adjust the root window. */
     pRoot = pScreen->root;
@@ -292,7 +292,7 @@ void QuartzUpdateScreens(void) {
     inputInfo.pointer->spriteInfo->sprite->physLimits = bounds;
     inputInfo.pointer->spriteInfo->sprite->hotLimits = bounds;
 
-    DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
+    DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, pScreen->x, pScreen->y);
 
     /* Send an event for the root reconfigure */
     e.u.u.type = ConfigureNotify;
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index c1c8b20..fdb8563 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -296,8 +296,8 @@ QuartzWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
     {
         int sx, sy;
 
-        sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
-        sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+        sx = pScreen->x + darwinMainScreenX;
+        sy = pScreen->y + darwinMainScreenY;
 
         CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y));
     }
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 4fa987c..7add0e3 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -243,11 +243,11 @@ winScreenInit (int index,
      Note the screen origin in a normalized coordinate space where (0,0) is at the top left
      of the native virtual desktop area
   */
-  dixScreenOrigins[index].x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
-  dixScreenOrigins[index].y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
+  pScreen->x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
+  pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
 
   ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n",
-         index, dixScreenOrigins[index].x, dixScreenOrigins[index].y);
+         index, pScreen->x, pScreen->y);
 
 #if CYGDEBUG || YES
   winDebug ("winScreenInit - returning\n");
diff --git a/include/globals.h b/include/globals.h
index 7de262f..8b80a65 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -22,8 +22,6 @@ extern _X_EXPORT int defaultColorVisualClass;
 extern _X_EXPORT int GrabInProgress;
 extern _X_EXPORT Bool noTestExtensions;
 
-extern _X_EXPORT DDXPointRec dixScreenOrigins[MAXSCREENS];
-
 extern _X_EXPORT char *ConnectionInfo;
 
 #ifdef DPMSExtension
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index f8171ca..d67b264 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -456,7 +456,7 @@ typedef    void (* DeviceCursorCleanupProcPtr)(
 typedef struct _Screen {
     int			myNum;	/* index of this instance in Screens[] */
     ATOM		id;
-    short		width, height;
+    short		x, y, width, height;
     short		mmWidth, mmHeight;
     short		numDepths;
     unsigned char      	rootDepth;
diff --git a/mi/miexpose.c b/mi/miexpose.c
index ee3ef72..088149b 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -424,8 +424,8 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
 	XID realWin = 0;
 
 	if(!pWin->parent) {
-	    x = dixScreenOrigins[scrnum].x;
-	    y = dixScreenOrigins[scrnum].y;
+	    x = screenInfo.screens[scrnum]->x;
+	    y = screenInfo.screens[scrnum]->y;
 	    pWin = screenInfo.screens[0]->root;
 	    realWin = pWin->drawable.id;
 	} else if (scrnum) {
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 5955cd9..ce088c7 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -53,9 +53,9 @@ extern Bool no_configure_window;
 
 #ifdef ROOTLESS_GLOBAL_COORDS
 #define SCREEN_TO_GLOBAL_X \
-    (dixScreenOrigins[pScreen->myNum].x + rootlessGlobalOffsetX)
+    (pScreen->x + rootlessGlobalOffsetX)
 #define SCREEN_TO_GLOBAL_Y \
-    (dixScreenOrigins[pScreen->myNum].y + rootlessGlobalOffsetY)
+    (pScreen->y + rootlessGlobalOffsetY)
 #else
 #define SCREEN_TO_GLOBAL_X 0
 #define SCREEN_TO_GLOBAL_Y 0
@@ -109,8 +109,8 @@ void RootlessNativeWindowMoved (WindowPtr pWin) {
     
     if (xp_get_window_bounds (MAKE_WINDOW_ID(winRec->wid), &bounds) != Success) return;
     
-    sx = dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX;
-    sy = dixScreenOrigins[pWin->drawable.pScreen->myNum].y + darwinMainScreenY;
+    sx = pWin->drawable.pScreen->x + darwinMainScreenX;
+    sy = pWin->drawable.pScreen->y + darwinMainScreenY;
     
     /* Fake up a ConfigureWindow packet to resize the window to the current bounds. */
     vlist[0] = (INT16) bounds.x1 - sx;
diff --git a/record/record.c b/record/record.c
index b81b7b2..46231c9 100644
--- a/record/record.c
+++ b/record/record.c
@@ -43,6 +43,7 @@ and Jim Haggerty of Metheus.
 #include "swaprep.h"
 #include "inputstr.h"
 #include "eventconvert.h"
+#include "scrnintstr.h"
 
 
 #include <stdio.h>
@@ -755,11 +756,11 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP,
 		int scr = XineramaGetCursorScreen(inputInfo.pointer);
 		memcpy(&shiftedEvent, pev, sizeof(xEvent));
 		shiftedEvent.u.keyButtonPointer.rootX +=
-		    dixScreenOrigins[scr].x -
-		    dixScreenOrigins[0].x;
+		    screenInfo.screens[scr]->x -
+		    screenInfo.screens[0]->x;
 		shiftedEvent.u.keyButtonPointer.rootY +=
-		    dixScreenOrigins[scr].y -
-		    dixScreenOrigins[0].y;
+		    screenInfo.screens[scr]->y -
+		    screenInfo.screens[0]->y;
 		pEvToRecord = &shiftedEvent;
 	    }
 #endif /* PANORAMIX */
diff --git a/render/render.c b/render/render.c
index 11c0927..78ecf43 100644
--- a/render/render.c
+++ b/render/render.c
@@ -2832,22 +2832,22 @@ PanoramiXRenderComposite (ClientPtr client)
 	stuff->src = src->info[j].id;
 	if (src->u.pict.root)
 	{
-	    stuff->xSrc = orig.xSrc - dixScreenOrigins[j].x;
-	    stuff->ySrc = orig.ySrc - dixScreenOrigins[j].y;
+	    stuff->xSrc = orig.xSrc - screenInfo.screens[j]->x;
+	    stuff->ySrc = orig.ySrc - screenInfo.screens[j]->y;
 	}
 	stuff->dst = dst->info[j].id;
 	if (dst->u.pict.root)
 	{
-	    stuff->xDst = orig.xDst - dixScreenOrigins[j].x;
-	    stuff->yDst = orig.yDst - dixScreenOrigins[j].y;
+	    stuff->xDst = orig.xDst - screenInfo.screens[j]->x;
+	    stuff->yDst = orig.yDst - screenInfo.screens[j]->y;
 	}
 	if (msk)
 	{
 	    stuff->mask = msk->info[j].id;
 	    if (msk->u.pict.root)
 	    {
-		stuff->xMask = orig.xMask - dixScreenOrigins[j].x;
-		stuff->yMask = orig.yMask - dixScreenOrigins[j].y;
+		stuff->xMask = orig.xMask - screenInfo.screens[j]->x;
+		stuff->yMask = orig.yMask - screenInfo.screens[j]->y;
 	    }
 	}
 	result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client);
@@ -2881,14 +2881,14 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client)
 	    stuff->src = src->info[j].id;
 	    if (src->u.pict.root)
 	    {
-		stuff->xSrc = xSrc - dixScreenOrigins[j].x;
-		stuff->ySrc = ySrc - dixScreenOrigins[j].y;
+		stuff->xSrc = xSrc - screenInfo.screens[j]->x;
+		stuff->ySrc = ySrc - screenInfo.screens[j]->y;
 	    }
 	    stuff->dst = dst->info[j].id;
 	    if (dst->u.pict.root)
 	    {
-		elt->deltax = origElt.deltax - dixScreenOrigins[j].x;
-		elt->deltay = origElt.deltay - dixScreenOrigins[j].y;
+		elt->deltax = origElt.deltax - screenInfo.screens[j]->x;
+		elt->deltay = origElt.deltay - screenInfo.screens[j]->y;
 	    }
 	    result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client);
 	    if(result != Success) break;
@@ -2918,8 +2918,8 @@ PanoramiXRenderFillRectangles (ClientPtr client)
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root)
 	    {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
 		    xRectangle	*rects = (xRectangle *) (stuff + 1);
@@ -2966,8 +2966,8 @@ PanoramiXRenderTrapezoids(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
                     xTrapezoid  *trap = (xTrapezoid *) (stuff + 1);
@@ -3026,8 +3026,8 @@ PanoramiXRenderTriangles(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
                     xTriangle  *tri = (xTriangle *) (stuff + 1);
@@ -3082,8 +3082,8 @@ PanoramiXRenderTriStrip(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
                     xPointFixed  *fixed = (xPointFixed *) (stuff + 1);
@@ -3134,8 +3134,8 @@ PanoramiXRenderTriFan(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-		int x_off = dixScreenOrigins[j].x;
-		int y_off = dixScreenOrigins[j].y;
+		int x_off = screenInfo.screens[j]->x;
+		int y_off = screenInfo.screens[j]->y;
 
 		if(x_off || y_off) {
                     xPointFixed  *fixed = (xPointFixed *) (stuff + 1);
@@ -3188,8 +3188,8 @@ PanoramiXRenderAddTraps (ClientPtr client)
 	    
 	    if (picture->u.pict.root)
 	    {
-		stuff->xOff = x_off + dixScreenOrigins[j].x;
-		stuff->yOff = y_off + dixScreenOrigins[j].y;
+		stuff->xOff = x_off + screenInfo.screens[j]->x;
+		stuff->yOff = y_off + screenInfo.screens[j]->y;
 	    }
 	    result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
 	    if(result != Success) break;
commit 217ccaa5a341018457f468a774c035c0df47d918
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sun May 23 11:05:01 2010 -0700

    Delete panoramiXdataPtr: it's redundant.
    
    This eliminates a dynamically-allocated MAXSCREENS-sized array.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index e1cef87..5f0e97e 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -70,7 +70,6 @@ int 		PanoramiXPixWidth = 0;
 int 		PanoramiXPixHeight = 0;
 int 		PanoramiXNumScreens = 0;
 
-PanoramiXData *panoramiXdataPtr = NULL;
 static RegionRec   	PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
 
 static int		PanoramiXNumDepths;
@@ -199,8 +198,8 @@ XineramaValidateGC(
 
     if((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr)pDraw)->parent)) {
 	/* the root window */
-	int x_off = panoramiXdataPtr[pGC->pScreen->myNum].x;
-	int y_off = panoramiXdataPtr[pGC->pScreen->myNum].y;
+	int x_off = dixScreenOrigins[pGC->pScreen->myNum].x;
+	int y_off = dixScreenOrigins[pGC->pScreen->myNum].y;
 	int new_val;
 
 	new_val = pGCPriv->clipOrg.x - x_off;
@@ -396,27 +395,23 @@ static void XineramaInitData(ScreenPtr pScreen)
 
         pScreen = screenInfo.screens[i];
 
-	panoramiXdataPtr[i].x = dixScreenOrigins[i].x;
-	panoramiXdataPtr[i].y = dixScreenOrigins[i].y;
-	panoramiXdataPtr[i].width = pScreen->width;
-	panoramiXdataPtr[i].height = pScreen->height;
-
-	TheBox.x1 = panoramiXdataPtr[i].x;
-	TheBox.x2 = TheBox.x1 + panoramiXdataPtr[i].width;
-	TheBox.y1 = panoramiXdataPtr[i].y;
-	TheBox.y2 = TheBox.y1 + panoramiXdataPtr[i].height;
+	TheBox.x1 = dixScreenOrigins[i].x;
+	TheBox.x2 = TheBox.x1 + pScreen->width;
+	TheBox.y1 = dixScreenOrigins[i].y;
+	TheBox.y2 = TheBox.y1 + pScreen->height;
 
 	REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1);
 	REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion,
 		     &XineramaScreenRegions[i]);
     }
 
-    PanoramiXPixWidth = panoramiXdataPtr[0].x + panoramiXdataPtr[0].width;
-    PanoramiXPixHeight = panoramiXdataPtr[0].y + panoramiXdataPtr[0].height;
+    PanoramiXPixWidth = dixScreenOrigins[0].x + screenInfo.screens[0]->width;
+    PanoramiXPixHeight = dixScreenOrigins[0].y + screenInfo.screens[0]->height;
 
     for (i = 1; i < PanoramiXNumScreens; i++) {
-	w = panoramiXdataPtr[i].x + panoramiXdataPtr[i].width;
-	h = panoramiXdataPtr[i].y + panoramiXdataPtr[i].height;
+	pScreen = screenInfo.screens[i];
+	w = dixScreenOrigins[i].x + pScreen->width;
+	h = dixScreenOrigins[i].y + pScreen->height;
 
 	if (PanoramiXPixWidth < w)
 	    PanoramiXPixWidth = w;
@@ -473,12 +468,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
 	 *	run in non-PanoramiXeen mode.
 	 */
 
-	panoramiXdataPtr = (PanoramiXData *) 
-		calloc(PanoramiXNumScreens, sizeof(PanoramiXData));
-
-	if (!panoramiXdataPtr)
-	    break;
-
 	if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) {
 		noPanoramiXExtension = TRUE;
 		return;
@@ -897,8 +886,6 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry)
     screenInfo.numScreens = PanoramiXNumScreens;
     for (i = 256; i--; )
 	ProcVector[i] = SavedProcVector[i];
-
-    free(panoramiXdataPtr);
 }
 
 
@@ -1000,8 +987,8 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
 	rep.length = 0;
 	rep.sequenceNumber = client->sequence;
 		/* screen dimensions */
-	rep.width  = panoramiXdataPtr[stuff->screen].width; 
-	rep.height = panoramiXdataPtr[stuff->screen].height; 
+	rep.width  = screenInfo.screens[stuff->screen]->width;
+	rep.height = screenInfo.screens[stuff->screen]->height;
 	rep.window = stuff->window;
 	rep.screen = stuff->screen;
     	if (client->swapped) {
@@ -1073,10 +1060,10 @@ ProcXineramaQueryScreens(ClientPtr client)
 	int i;
 
 	for(i = 0; i < PanoramiXNumScreens; i++) {
-	    scratch.x_org  = panoramiXdataPtr[i].x;
-	    scratch.y_org  = panoramiXdataPtr[i].y;
-	    scratch.width  = panoramiXdataPtr[i].width;
-	    scratch.height = panoramiXdataPtr[i].height;
+	    scratch.x_org  = dixScreenOrigins[i].x;
+	    scratch.y_org  = dixScreenOrigins[i].y;
+	    scratch.width  = screenInfo.screens[i]->width;
+	    scratch.height = screenInfo.screens[i]->height;
 	
 	    if(client->swapped) {
 		int n;
@@ -1166,8 +1153,8 @@ XineramaGetImageData(
     SrcBox.x1 = left;
     SrcBox.y1 = top;
     if(!isRoot) {
-	SrcBox.x1 += pDraw->x + panoramiXdataPtr[0].x;
-	SrcBox.y1 += pDraw->y + panoramiXdataPtr[0].y;
+	SrcBox.x1 += pDraw->x + dixScreenOrigins[0].x;
+	SrcBox.y1 += pDraw->y + dixScreenOrigins[0].y;
     }
     SrcBox.x2 = SrcBox.x1 + width;
     SrcBox.y2 = SrcBox.y1 + height;
@@ -1184,8 +1171,8 @@ XineramaGetImageData(
 
 	if(inOut == rgnIN) {	   
 	    (*pDraw->pScreen->GetImage)(pDraw, 
-			SrcBox.x1 - pDraw->x - panoramiXdataPtr[i].x,
-			SrcBox.y1 - pDraw->y - panoramiXdataPtr[i].y, 
+			SrcBox.x1 - pDraw->x - dixScreenOrigins[i].x,
+			SrcBox.y1 - pDraw->y - dixScreenOrigins[i].y,
 			width, height, format, planemask, data);
 	    break;
 	} else if (inOut == rgnOUT)
@@ -1216,8 +1203,8 @@ XineramaGetImageData(
 		    }	
 		}
 
-		x = pbox->x1 - pDraw->x - panoramiXdataPtr[i].x;
-		y = pbox->y1 - pDraw->y - panoramiXdataPtr[i].y;
+		x = pbox->x1 - pDraw->x - dixScreenOrigins[i].x;
+		y = pbox->y1 - pDraw->y - dixScreenOrigins[i].y;
 
 		(*pDraw->pScreen->GetImage)(pDraw, x, y, w, h, 
 					format, planemask, ScratchMem);
diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index 35de179..a8684f0 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -46,13 +46,6 @@ Equipment Corporation.
 #include "gcstruct.h"
 
 
-typedef struct _PanoramiXData {
-    int x;
-    int y;
-    int width;
-    int height;
-} PanoramiXData;
-
 typedef struct _PanoramiXInfo {
     XID id ;
 } PanoramiXInfo;
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 6b199cf..ccd7216 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -135,8 +135,8 @@ int PanoramiXCreateWindow(ClientPtr client)
         stuff->wid = newWin->info[j].id;
         stuff->parent = parent->info[j].id;
 	if (parentIsRoot) {
-	    stuff->x = orig_x - panoramiXdataPtr[j].x;
-	    stuff->y = orig_y - panoramiXdataPtr[j].y;
+	    stuff->x = orig_x - dixScreenOrigins[j].x;
+	    stuff->y = orig_y - dixScreenOrigins[j].y;
 	}
 	if (backPix)
 	    *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
@@ -334,8 +334,8 @@ int PanoramiXReparentWindow(ClientPtr client)
 	stuff->window = win->info[j].id;
 	stuff->parent = parent->info[j].id;
 	if(parentIsRoot) {
-	    stuff->x = x - panoramiXdataPtr[j].x;
-	    stuff->y = y - panoramiXdataPtr[j].y;
+	    stuff->x = x - dixScreenOrigins[j].x;
+	    stuff->y = y - dixScreenOrigins[j].y;
 	}
 	result = (*SavedProcVector[X_ReparentWindow])(client);
         if(result != Success) break;
@@ -495,9 +495,9 @@ int PanoramiXConfigureWindow(ClientPtr client)
 	if(sib)
 	    *((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id;
 	if(x_offset >= 0)
-	    *((CARD32 *) &stuff[1] + x_offset) = x - panoramiXdataPtr[j].x;
+	    *((CARD32 *) &stuff[1] + x_offset) = x - dixScreenOrigins[j].x;
 	if(y_offset >= 0)
-	    *((CARD32 *) &stuff[1] + y_offset) = y - panoramiXdataPtr[j].y;
+	    *((CARD32 *) &stuff[1] + y_offset) = y - dixScreenOrigins[j].y;
 	result = (*SavedProcVector[X_ConfigureWindow])(client);
         if(result != Success) break;
     }
@@ -565,8 +565,8 @@ int PanoramiXGetGeometry(ClientPtr client)
 	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.x += dixScreenOrigins[0].x;
+	   rep.y += dixScreenOrigins[0].y;
 	}
 	rep.borderWidth = pWin->borderWidth;
     }
@@ -599,8 +599,8 @@ int PanoramiXTranslateCoords(ClientPtr client)
     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;
+	x = stuff->srcX - dixScreenOrigins[0].x;
+	y = stuff->srcY - dixScreenOrigins[0].y;
     } else {
 	x = pWin->drawable.x + stuff->srcX;
 	y = pWin->drawable.y + stuff->srcY;
@@ -637,8 +637,8 @@ int PanoramiXTranslateCoords(ClientPtr client)
     if((pDst == screenInfo.screens[0]->root) ||
        (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
     {
-	rep.dstX += panoramiXdataPtr[0].x;
-	rep.dstY += panoramiXdataPtr[0].y;
+	rep.dstX += dixScreenOrigins[0].x;
+	rep.dstY += dixScreenOrigins[0].y;
     }
 
     WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
@@ -981,8 +981,8 @@ int PanoramiXClearToBackground(ClientPtr client)
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->window = win->info[j].id;
 	if(isRoot) {
-	    stuff->x = x - panoramiXdataPtr[j].x;
-	    stuff->y = y - panoramiXdataPtr[j].y;
+	    stuff->x = x - dixScreenOrigins[j].x;
+	    stuff->y = y - dixScreenOrigins[j].y;
 	}
 	result = (*SavedProcVector[X_ClearArea])(client);
 	if(result != Success) break;
@@ -1092,12 +1092,12 @@ int PanoramiXCopyArea(ClientPtr client)
 	    stuff->srcDrawable = src->info[j].id;
 	    stuff->gc          = gc->info[j].id;
  	    if (srcIsRoot) {	
-		stuff->srcX = srcx - panoramiXdataPtr[j].x;
-		stuff->srcY = srcy - panoramiXdataPtr[j].y;
+		stuff->srcX = srcx - dixScreenOrigins[j].x;
+		stuff->srcY = srcy - dixScreenOrigins[j].y;
 	    }
  	    if (dstIsRoot) {	
-		stuff->dstX = dstx - panoramiXdataPtr[j].x;
-		stuff->dstY = dsty - panoramiXdataPtr[j].y;
+		stuff->dstX = dstx - dixScreenOrigins[j].x;
+		stuff->dstY = dsty - dixScreenOrigins[j].y;
 	    }
 
 	    VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
@@ -1137,7 +1137,7 @@ int PanoramiXCopyArea(ClientPtr client)
 		if(pRgn[j]) {
 		   if(srcIsRoot) {
 		       REGION_TRANSLATE(pScreen, pRgn[j], 
-				panoramiXdataPtr[j].x, panoramiXdataPtr[j].y);
+				dixScreenOrigins[j].x, dixScreenOrigins[j].y);
 		   }
 		   REGION_APPEND(pScreen, &totalReg, pRgn[j]);
 		   REGION_DESTROY(pScreen, pRgn[j]);
@@ -1203,12 +1203,12 @@ int PanoramiXCopyPlane(ClientPtr client)
 	stuff->srcDrawable = src->info[j].id;
 	stuff->gc          = gc->info[j].id;
 	if (srcIsRoot) {	
-	    stuff->srcX = srcx - panoramiXdataPtr[j].x;
-	    stuff->srcY = srcy - panoramiXdataPtr[j].y;
+	    stuff->srcX = srcx - dixScreenOrigins[j].x;
+	    stuff->srcY = srcy - dixScreenOrigins[j].y;
 	}
 	if (dstIsRoot) {	
-	    stuff->dstX = dstx - panoramiXdataPtr[j].x;
-	    stuff->dstY = dsty - panoramiXdataPtr[j].y;
+	    stuff->dstX = dstx - dixScreenOrigins[j].x;
+	    stuff->dstY = dsty - dixScreenOrigins[j].y;
 	}
 
 	VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
@@ -1297,8 +1297,8 @@ int PanoramiXPolyPoint(ClientPtr client)
             if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
 
             if (isRoot) {
-                int x_off = panoramiXdataPtr[j].x;
-                int y_off = panoramiXdataPtr[j].y;
+                int x_off = dixScreenOrigins[j].x;
+                int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
                     xPoint *pnts = (xPoint*)&stuff[1];
@@ -1357,8 +1357,8 @@ int PanoramiXPolyLine(ClientPtr client)
             if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
 
             if (isRoot) {
-                int x_off = panoramiXdataPtr[j].x;
-                int y_off = panoramiXdataPtr[j].y;
+                int x_off = dixScreenOrigins[j].x;
+                int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
 		    xPoint *pnts = (xPoint*)&stuff[1];
@@ -1420,8 +1420,8 @@ int PanoramiXPolySegment(ClientPtr client)
             if(j) memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment));
 
             if (isRoot) {
-                int x_off = panoramiXdataPtr[j].x;
-                int y_off = panoramiXdataPtr[j].y;
+                int x_off = dixScreenOrigins[j].x;
+                int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
 		    xSegment *segs = (xSegment*)&stuff[1];
@@ -1483,8 +1483,8 @@ int PanoramiXPolyRectangle(ClientPtr client)
             if(j) memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle));
 
 	    if (isRoot) {
-		int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 
 		if(x_off || y_off) {
@@ -1545,8 +1545,8 @@ int PanoramiXPolyArc(ClientPtr client)
             if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
 
 	    if (isRoot) {
-		int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 	
 		if(x_off || y_off) {
 		    xArc *arcs = (xArc *) &stuff[1];
@@ -1603,8 +1603,8 @@ int PanoramiXFillPoly(ClientPtr client)
 	    if(j) memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec));
 
 	    if (isRoot) {
-		int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
 		    DDXPointPtr pnts = (DDXPointPtr)&stuff[1];
@@ -1666,8 +1666,8 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
 	    if(j) memcpy(&stuff[1], origRects, things * sizeof(xRectangle));
 
 	    if (isRoot) {
-		int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
 		    xRectangle *rects = (xRectangle *) &stuff[1];
@@ -1727,8 +1727,8 @@ int PanoramiXPolyFillArc(ClientPtr client)
 	    if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
 
 	    if (isRoot) {
-		int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
 		    xArc *arcs = (xArc *) &stuff[1];
@@ -1780,8 +1780,8 @@ int PanoramiXPutImage(ClientPtr client)
     orig_y = stuff->dstY;
     FOR_NSCREENS_BACKWARD(j){
 	if (isRoot) {
-    	  stuff->dstX = orig_x - panoramiXdataPtr[j].x;
-	  stuff->dstY = orig_y - panoramiXdataPtr[j].y;
+	  stuff->dstX = orig_x - dixScreenOrigins[j].x;
+	  stuff->dstY = orig_y - dixScreenOrigins[j].y;
 	}
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
@@ -1846,10 +1846,10 @@ int PanoramiXGetImage(ClientPtr client)
 	    return(BadMatch);
     } else {
       if( /* check for being onscreen */
-	panoramiXdataPtr[0].x + pDraw->x + x < 0 ||
-	panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
-        panoramiXdataPtr[0].y + pDraw->y + y < 0 ||
-	panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
+	dixScreenOrigins[0].x + pDraw->x + x < 0 ||
+	dixScreenOrigins[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
+	dixScreenOrigins[0].y + pDraw->y + y < 0 ||
+	dixScreenOrigins[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
 	 /* check for being inside of border */
        	x < - wBorderWidth((WindowPtr)pDraw) ||
 	x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
@@ -1983,8 +1983,8 @@ PanoramiXPolyText8(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - panoramiXdataPtr[j].x;
-	    stuff->y = orig_y - panoramiXdataPtr[j].y;
+	    stuff->x = orig_x - dixScreenOrigins[j].x;
+	    stuff->y = orig_y - dixScreenOrigins[j].y;
 	}
 	result = (*SavedProcVector[X_PolyText8])(client);
 	if(result != Success) break;
@@ -2024,8 +2024,8 @@ PanoramiXPolyText16(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - panoramiXdataPtr[j].x;
-	    stuff->y = orig_y - panoramiXdataPtr[j].y;
+	    stuff->x = orig_x - dixScreenOrigins[j].x;
+	    stuff->y = orig_y - dixScreenOrigins[j].y;
 	}
 	result = (*SavedProcVector[X_PolyText16])(client);
 	if(result != Success) break;
@@ -2065,8 +2065,8 @@ int PanoramiXImageText8(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - panoramiXdataPtr[j].x;
-	    stuff->y = orig_y - panoramiXdataPtr[j].y;
+	    stuff->x = orig_x - dixScreenOrigins[j].x;
+	    stuff->y = orig_y - dixScreenOrigins[j].y;
 	}
 	result = (*SavedProcVector[X_ImageText8])(client);
 	if(result != Success) break;
@@ -2106,8 +2106,8 @@ int PanoramiXImageText16(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->x = orig_x - panoramiXdataPtr[j].x;
-	    stuff->y = orig_y - panoramiXdataPtr[j].y;
+	    stuff->x = orig_x - dixScreenOrigins[j].x;
+	    stuff->y = orig_y - dixScreenOrigins[j].y;
 	}
 	result = (*SavedProcVector[X_ImageText16])(client);
 	if(result != Success) break;
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index c77b119..af0017d 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -9,7 +9,6 @@
 #include "panoramiX.h"
 
 extern _X_EXPORT int PanoramiXNumScreens;
-extern _X_EXPORT PanoramiXData *panoramiXdataPtr;
 extern _X_EXPORT int PanoramiXPixWidth;
 extern _X_EXPORT int PanoramiXPixHeight;
 
diff --git a/Xext/shm.c b/Xext/shm.c
index 3d9c633..99cd39e 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -598,8 +598,8 @@ ProcPanoramiXShmPutImage(ClientPtr client)
 	stuff->drawable = draw->info[j].id;
 	stuff->gc = gc->info[j].id;
 	if (isRoot) {
-	    stuff->dstX = orig_x - panoramiXdataPtr[j].x;
-	    stuff->dstY = orig_y - panoramiXdataPtr[j].y;
+	    stuff->dstX = orig_x - dixScreenOrigins[j].x;
+	    stuff->dstY = orig_y - dixScreenOrigins[j].y;
 	}
 	result = ProcShmPutImage(client);
 	if(result != Success) break;
@@ -660,10 +660,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
 	    return(BadMatch);
     } else {
       if( /* check for being onscreen */
-	panoramiXdataPtr[0].x + pDraw->x + x < 0 ||
-	panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
-        panoramiXdataPtr[0].y + pDraw->y + y < 0 ||
-	panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
+	dixScreenOrigins[0].x + pDraw->x + x < 0 ||
+	dixScreenOrigins[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
+	dixScreenOrigins[0].y + pDraw->y + y < 0 ||
+	dixScreenOrigins[0].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 d7338ad..efbe973 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1690,8 +1690,8 @@ XineramaXvShmPutImage(ClientPtr client)
 	   stuff->drw_x = x;
 	   stuff->drw_y = y;
 	   if(isRoot) {
-		stuff->drw_x -= panoramiXdataPtr[i].x;
-		stuff->drw_y -= panoramiXdataPtr[i].y;
+		stuff->drw_x -= dixScreenOrigins[i].x;
+		stuff->drw_y -= dixScreenOrigins[i].y;
 	   }
 	   stuff->send_event = (send_event && !i) ? 1 : 0;
 
@@ -1742,8 +1742,8 @@ XineramaXvPutImage(ClientPtr client)
 	   stuff->drw_x = x;
 	   stuff->drw_y = y;
 	   if(isRoot) {
-		stuff->drw_x -= panoramiXdataPtr[i].x;
-		stuff->drw_y -= panoramiXdataPtr[i].y;
+		stuff->drw_x -= dixScreenOrigins[i].x;
+		stuff->drw_y -= dixScreenOrigins[i].y;
 	   }
 
 	   result = ProcXvPutImage(client);
@@ -1790,8 +1790,8 @@ XineramaXvPutVideo(ClientPtr client)
            stuff->drw_x = x;
            stuff->drw_y = y;
            if(isRoot) {
-                stuff->drw_x -= panoramiXdataPtr[i].x;
-                stuff->drw_y -= panoramiXdataPtr[i].y;
+                stuff->drw_x -= dixScreenOrigins[i].x;
+                stuff->drw_y -= dixScreenOrigins[i].y;
            }
 
            result = ProcXvPutVideo(client);
@@ -1838,8 +1838,8 @@ XineramaXvPutStill(ClientPtr client)
            stuff->drw_x = x;
            stuff->drw_y = y;
            if(isRoot) {
-                stuff->drw_x -= panoramiXdataPtr[i].x;
-                stuff->drw_y -= panoramiXdataPtr[i].y;
+                stuff->drw_x -= dixScreenOrigins[i].x;
+                stuff->drw_y -= dixScreenOrigins[i].y;
            }
 
            result = ProcXvPutStill(client);
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index 41253fb..a0c26ba 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -181,12 +181,12 @@ ProcXIQueryPointer(ClientPtr client)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-        rep.root_x += FP1616(panoramiXdataPtr[0].x, 0);
-        rep.root_y += FP1616(panoramiXdataPtr[0].y, 0);
+        rep.root_x += FP1616(dixScreenOrigins[0].x, 0);
+        rep.root_y += FP1616(dixScreenOrigins[0].y, 0);
         if (stuff->win == rep.root)
         {
-            rep.win_x += FP1616(panoramiXdataPtr[0].x, 0);
-            rep.win_y += FP1616(panoramiXdataPtr[0].y, 0);
+            rep.win_x += FP1616(dixScreenOrigins[0].x, 0);
+            rep.win_y += FP1616(dixScreenOrigins[0].y, 0);
         }
     }
 #endif
diff --git a/dix/events.c b/dix/events.c
index 0186596..21ee85e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -502,8 +502,8 @@ XineramaSetCursorPosition(
        that screen are. */
 
     pScreen = pSprite->screen;
-    x += panoramiXdataPtr[0].x;
-    y += panoramiXdataPtr[0].y;
+    x += dixScreenOrigins[0].x;
+    y += dixScreenOrigins[0].y;
 
     if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
 								x, y, &box))
@@ -521,10 +521,10 @@ XineramaSetCursorPosition(
     }
 
     pSprite->screen = pScreen;
-    pSprite->hotPhys.x = x - panoramiXdataPtr[0].x;
-    pSprite->hotPhys.y = y - panoramiXdataPtr[0].y;
-    x -= panoramiXdataPtr[pScreen->myNum].x;
-    y -= panoramiXdataPtr[pScreen->myNum].y;
+    pSprite->hotPhys.x = x - dixScreenOrigins[0].x;
+    pSprite->hotPhys.y = y - dixScreenOrigins[0].y;
+    x -= dixScreenOrigins[pScreen->myNum].x;
+    y -= dixScreenOrigins[pScreen->myNum].y;
 
     return (*pScreen->SetCursorPosition)(pDev, pScreen, x, y, generateEvent);
 }
@@ -542,10 +542,10 @@ XineramaConstrainCursor(DeviceIntPtr pDev)
 
     /* Translate the constraining box to the screen
        the sprite is actually on */
-    newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
-    newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
-    newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
-    newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
+    newBox.x1 += dixScreenOrigins[0].x - dixScreenOrigins[pScreen->myNum].x;
+    newBox.x2 += dixScreenOrigins[0].x - dixScreenOrigins[pScreen->myNum].x;
+    newBox.y1 += dixScreenOrigins[0].y - dixScreenOrigins[pScreen->myNum].y;
+    newBox.y2 += dixScreenOrigins[0].y - dixScreenOrigins[pScreen->myNum].y;
 
     (* pScreen->ConstrainCursor)(pDev, pScreen, &newBox);
 }
@@ -595,12 +595,12 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
 
     REGION_COPY(pSprite->screen, &pSprite->Reg1,
             &pSprite->windows[i]->borderSize);
-    off_x = panoramiXdataPtr[i].x;
-    off_y = panoramiXdataPtr[i].y;
+    off_x = dixScreenOrigins[i].x;
+    off_y = dixScreenOrigins[i].y;
 
     while(i--) {
-        x = off_x - panoramiXdataPtr[i].x;
-        y = off_y - panoramiXdataPtr[i].y;
+        x = off_x - dixScreenOrigins[i].x;
+        y = off_y - dixScreenOrigins[i].y;
 
         if(x || y)
             REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, x, y);
@@ -608,8 +608,8 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
         REGION_UNION(pSprite->screen, &pSprite->Reg1, &pSprite->Reg1,
                 &pSprite->windows[i]->borderSize);
 
-        off_x = panoramiXdataPtr[i].x;
-        off_y = panoramiXdataPtr[i].y;
+        off_x = dixScreenOrigins[i].x;
+        off_y = dixScreenOrigins[i].y;
     }
 
     pSprite->hotLimits = *REGION_EXTENTS(pSprite->screen, &pSprite->Reg1);
@@ -814,12 +814,12 @@ CheckVirtualMotion(
 
             REGION_COPY(pSprite->screen, &pSprite->Reg2,
                     &pSprite->windows[i]->borderSize);
-            off_x = panoramiXdataPtr[i].x;
-            off_y = panoramiXdataPtr[i].y;
+            off_x = dixScreenOrigins[i].x;
+            off_y = dixScreenOrigins[i].y;
 
             while(i--) {
-                x = off_x - panoramiXdataPtr[i].x;
-                y = off_y - panoramiXdataPtr[i].y;
+                x = off_x - dixScreenOrigins[i].x;
+                y = off_y - dixScreenOrigins[i].y;
 
                 if(x || y)
                     REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, x, y);
@@ -827,8 +827,8 @@ CheckVirtualMotion(
                 REGION_UNION(pSprite->screen, &pSprite->Reg2, &pSprite->Reg2,
                         &pSprite->windows[i]->borderSize);
 
-                off_x = panoramiXdataPtr[i].x;
-                off_y = panoramiXdataPtr[i].y;
+                off_x = dixScreenOrigins[i].x;
+                off_y = dixScreenOrigins[i].y;
             }
         } else
 #endif
@@ -1135,10 +1135,10 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
     {
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension) {
-            event->root_x += panoramiXdataPtr[pSprite->screen->myNum].x -
-			      panoramiXdataPtr[0].x;
-	    event->root_y += panoramiXdataPtr[pSprite->screen->myNum].y -
-			      panoramiXdataPtr[0].y;
+	    event->root_x += dixScreenOrigins[pSprite->screen->myNum].x -
+			      dixScreenOrigins[0].x;
+	    event->root_y += dixScreenOrigins[pSprite->screen->myNum].y -
+			      dixScreenOrigins[0].y;
 	}
 #endif
 	pSprite->hotPhys.x = event->root_x;
@@ -1218,10 +1218,10 @@ PlayReleasedEvents(void)
                     case ET_KeyRelease:
                     case ET_ProximityIn:
                     case ET_ProximityOut:
-                        ev->root_x += panoramiXdataPtr[0].x -
-                            panoramiXdataPtr[pDev->spriteInfo->sprite->screen->myNum].x;
-                        ev->root_y += panoramiXdataPtr[0].y -
-                            panoramiXdataPtr[pDev->spriteInfo->sprite->screen->myNum].y;
+                        ev->root_x += dixScreenOrigins[0].x -
+                            dixScreenOrigins[pDev->spriteInfo->sprite->screen->myNum].x;
+                        ev->root_y += dixScreenOrigins[0].y -
+                            dixScreenOrigins[pDev->spriteInfo->sprite->screen->myNum].y;
                         break;
                     default:
                         break;
@@ -2561,8 +2561,8 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
 	for(i = 1; i < PanoramiXNumScreens; i++) {
 	   if(POINT_IN_REGION(pSprite->screen,
 			&pSprite->windows[i]->borderSize,
-			x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
-			y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
+			x + dixScreenOrigins[0].x - dixScreenOrigins[i].x,
+			y + dixScreenOrigins[0].y - dixScreenOrigins[i].y,
 			&box))
 		return TRUE;
 	}
@@ -2757,10 +2757,10 @@ 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 += panoramiXdataPtr[pSprite->screen->myNum].x -
-                                       panoramiXdataPtr[0].x;
-            ev->root_y += panoramiXdataPtr[pSprite->screen->myNum].y -
-                                       panoramiXdataPtr[0].y;
+            ev->root_x += dixScreenOrigins[pSprite->screen->myNum].x -
+                                       dixScreenOrigins[0].x;
+            ev->root_y += dixScreenOrigins[pSprite->screen->myNum].y -
+                                       dixScreenOrigins[0].y;
         } else
 #endif
         {
@@ -3008,10 +3008,10 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
     }
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-        pSprite->hotLimits.x1 = -panoramiXdataPtr[0].x;
-        pSprite->hotLimits.y1 = -panoramiXdataPtr[0].y;
-        pSprite->hotLimits.x2 = PanoramiXPixWidth  - panoramiXdataPtr[0].x;
-        pSprite->hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
+        pSprite->hotLimits.x1 = -dixScreenOrigins[0].x;
+        pSprite->hotLimits.y1 = -dixScreenOrigins[0].y;
+        pSprite->hotLimits.x2 = PanoramiXPixWidth  - dixScreenOrigins[0].x;
+        pSprite->hotLimits.y2 = PanoramiXPixHeight - dixScreenOrigins[0].y;
         pSprite->physLimits = pSprite->hotLimits;
         pSprite->confineWin = NullWindow;
         pSprite->hotShape = NullRegion;
@@ -3078,10 +3078,10 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-        pSprite->hotLimits.x1 = -panoramiXdataPtr[0].x;
-        pSprite->hotLimits.y1 = -panoramiXdataPtr[0].y;
-        pSprite->hotLimits.x2 = PanoramiXPixWidth  - panoramiXdataPtr[0].x;
-        pSprite->hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
+        pSprite->hotLimits.x1 = -dixScreenOrigins[0].x;
+        pSprite->hotLimits.y1 = -dixScreenOrigins[0].y;
+        pSprite->hotLimits.x2 = PanoramiXPixWidth  - dixScreenOrigins[0].x;
+        pSprite->hotLimits.y2 = PanoramiXPixHeight - dixScreenOrigins[0].y;
         pSprite->physLimits = pSprite->hotLimits;
         pSprite->screen = pScreen;
     }
@@ -3114,10 +3114,10 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
     pSprite->hotPhys.y = y;
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-	pSprite->hotPhys.x += panoramiXdataPtr[newScreen->myNum].x -
-			    panoramiXdataPtr[0].x;
-	pSprite->hotPhys.y += panoramiXdataPtr[newScreen->myNum].y -
-			    panoramiXdataPtr[0].y;
+	pSprite->hotPhys.x += dixScreenOrigins[newScreen->myNum].x -
+			    dixScreenOrigins[0].x;
+	pSprite->hotPhys.y += dixScreenOrigins[newScreen->myNum].y -
+			    dixScreenOrigins[0].y;
 	if (newScreen != pSprite->screen) {
 	    pSprite->screen = newScreen;
 	    /* Make sure we tell the DDX to update its copy of the screen */
@@ -3132,10 +3132,10 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
 		(*pSprite->screen->SetCursorPosition)(
                                                       pDev,
                                                       pSprite->screen,
-		    pSprite->hotPhys.x + panoramiXdataPtr[0].x -
-			panoramiXdataPtr[pSprite->screen->myNum].x,
-		    pSprite->hotPhys.y + panoramiXdataPtr[0].y -
-			panoramiXdataPtr[pSprite->screen->myNum].y, FALSE);
+		    pSprite->hotPhys.x + dixScreenOrigins[0].x -
+			dixScreenOrigins[pSprite->screen->myNum].x,
+		    pSprite->hotPhys.y + dixScreenOrigins[0].y -
+			dixScreenOrigins[pSprite->screen->myNum].y, FALSE);
 	}
     } else
 #endif
@@ -3163,14 +3163,14 @@ XineramaPointInWindowIsVisible(
 
     if(!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE;
 
-    xoff = x + panoramiXdataPtr[0].x;
-    yoff = y + panoramiXdataPtr[0].y;
+    xoff = x + dixScreenOrigins[0].x;
+    yoff = y + dixScreenOrigins[0].y;
 
     for(i = 1; i < PanoramiXNumScreens; i++) {
 	pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
 	pScreen = pWin->drawable.pScreen;
-	x = xoff - panoramiXdataPtr[i].x;
-	y = yoff - panoramiXdataPtr[i].y;
+	x = xoff - dixScreenOrigins[i].x;
+	y = yoff - dixScreenOrigins[i].y;
 
 	if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)
 	   && (!wInputShape(pWin) ||
@@ -3216,8 +3216,8 @@ XineramaWarpPointer(ClientPtr client)
 	winX = source->drawable.x;
 	winY = source->drawable.y;
 	if(source == screenInfo.screens[0]->root) {
-	    winX -= panoramiXdataPtr[0].x;
-	    winY -= panoramiXdataPtr[0].y;
+	    winX -= dixScreenOrigins[0].x;
+	    winY -= dixScreenOrigins[0].y;
 	}
 	if (x < winX + stuff->srcX ||
 	    y < winY + stuff->srcY ||
@@ -3232,8 +3232,8 @@ XineramaWarpPointer(ClientPtr client)
 	x = dest->drawable.x;
 	y = dest->drawable.y;
 	if(dest == screenInfo.screens[0]->root) {
-	    x -= panoramiXdataPtr[0].x;
-	    y -= panoramiXdataPtr[0].y;
+	    x -= dixScreenOrigins[0].x;
+	    y -= dixScreenOrigins[0].y;
 	}
     }
 
@@ -4997,11 +4997,11 @@ ProcQueryPointer(ClientPtr client)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
-	rep.rootX += panoramiXdataPtr[0].x;
-	rep.rootY += panoramiXdataPtr[0].y;
+	rep.rootX += dixScreenOrigins[0].x;
+	rep.rootY += dixScreenOrigins[0].y;
 	if(stuff->id == rep.root) {
-	    rep.winX += panoramiXdataPtr[0].x;
-	    rep.winY += panoramiXdataPtr[0].y;
+	    rep.winX += dixScreenOrigins[0].x;
+	    rep.winY += dixScreenOrigins[0].y;
 	}
     }
 #endif
@@ -5670,7 +5670,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
 
 #ifdef PANORAMIX
     if(!noPanoramiXExtension &&
-       (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y))
+       (dixScreenOrigins[0].x || dixScreenOrigins[0].y))
     {
 	switch(events->u.u.type) {
 	case MotionNotify:
@@ -5687,13 +5687,13 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
         */
 	    count = 1;  /* should always be 1 */
 	    memcpy(&eventCopy, events, sizeof(xEvent));
-	    eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x;
-	    eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y;
+	    eventCopy.u.keyButtonPointer.rootX += dixScreenOrigins[0].x;
+	    eventCopy.u.keyButtonPointer.rootY += dixScreenOrigins[0].y;
 	    if(eventCopy.u.keyButtonPointer.event ==
 	       eventCopy.u.keyButtonPointer.root)
 	    {
-		eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x;
-		eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y;
+		eventCopy.u.keyButtonPointer.eventX += dixScreenOrigins[0].x;
+		eventCopy.u.keyButtonPointer.eventY += dixScreenOrigins[0].y;
 	    }
 	    events = &eventCopy;
 	    break;
diff --git a/dix/getevents.c b/dix/getevents.c
index eeef414..3ca5883 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1210,8 +1210,8 @@ PostSyntheticMotion(DeviceIntPtr pDev,
        will translate from sprite screen to screen 0 upon reentry
        to the DIX layer. */
     if (!noPanoramiXExtension) {
-        x += panoramiXdataPtr[0].x - panoramiXdataPtr[screen].x;
-        y += panoramiXdataPtr[0].y - panoramiXdataPtr[screen].y;
+        x += dixScreenOrigins[0].x - dixScreenOrigins[screen].x;
+        y += dixScreenOrigins[0].y - dixScreenOrigins[screen].y;
     }
 #endif
 
diff --git a/dix/window.c b/dix/window.c
index 71edd46..8345523 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2236,8 +2236,8 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 	event.u.configureRequest.y = y;
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension && (!pParent || !pParent->parent)) {
-            event.u.configureRequest.x += panoramiXdataPtr[0].x;
-            event.u.configureRequest.y += panoramiXdataPtr[0].y;
+            event.u.configureRequest.x += dixScreenOrigins[0].x;
+            event.u.configureRequest.y += dixScreenOrigins[0].y;
 	}
 #endif
 	event.u.configureRequest.width = w;
@@ -2317,8 +2317,8 @@ ActuallyDoSomething:
 	event.u.configureNotify.y = y;
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension && (!pParent || !pParent->parent)) {
-	    event.u.configureNotify.x += panoramiXdataPtr[0].x;
-            event.u.configureNotify.y += panoramiXdataPtr[0].y;
+	    event.u.configureNotify.x += dixScreenOrigins[0].x;
+	    event.u.configureNotify.y += dixScreenOrigins[0].y;
 	}
 #endif
 	event.u.configureNotify.width = w;
@@ -2471,8 +2471,8 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
     event.u.reparent.y = y;
 #ifdef PANORAMIX
     if(!noPanoramiXExtension && !pParent->parent) {
-	event.u.reparent.x += panoramiXdataPtr[0].x;
-	event.u.reparent.y += panoramiXdataPtr[0].y;
+	event.u.reparent.x += dixScreenOrigins[0].x;
+	event.u.reparent.y += dixScreenOrigins[0].y;
     }
 #endif
     event.u.reparent.override = pWin->overrideRedirect;
diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml
index 12d7067..251e6ac 100644
--- a/hw/dmx/doc/dmx.xml
+++ b/hw/dmx/doc/dmx.xml
@@ -1497,9 +1497,7 @@ PanoramiX prefix.
     <para>The Xinerama extension is registered by calling AddExtension().
     </para>
 
-    <para>A local per-screen array of data structures
-    (panoramiXdataPtr&lsqb;&rsqb;)
-    is allocated for each physical screen, and GC and Screen private
+    <para>GC and Screen private
     indexes are allocated, and both GC and Screen private areas are
     allocated for each physical screen.  These hold Xinerama-specific
     per-GC and per-Screen data.  Each screen's CreateGC and CloseScreen
@@ -1511,9 +1509,8 @@ PanoramiX prefix.
 
     <para>A region (XineramaScreenRegions&lsqb;i&rsqb;) is initialized for each
     physical screen, and single region (PanoramiXScreenRegion) is
-    initialized to be the union of the screen regions.  The
-    panoramiXdataPtr&lsqb;&rsqb; array is also initialized with the size and
-    origin of each screen.  The relative positioning information for the
+    initialized to be the union of the screen regions.
+    The relative positioning information for the
     physical screens is taken from the array
     dixScreenOrigins&lsqb;&rsqb;, which
     the DDX layer must initialize in InitOutput().  The bounds of the
diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index 5868ab1..298ec2b 100644
--- a/hw/xquartz/pseudoramiX.c
+++ b/hw/xquartz/pseudoramiX.c
@@ -255,9 +255,9 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     /* screen dimensions */
     rep.width  = pseudoramiXScreens[stuff->screen].w;
-    // was panoramiXdataPtr[stuff->screen].width;
+    // was screenInfo.screens[stuff->screen]->width;
     rep.height = pseudoramiXScreens[stuff->screen].h;
-    // was panoramiXdataPtr[stuff->screen].height;
+    // was screenInfo.screens[stuff->screen]->height;
     if (client->swapped) {
         swaps (&rep.sequenceNumber, n);
         swapl (&rep.length, n);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 9249ca9..ee3ef72 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -424,8 +424,8 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
 	XID realWin = 0;
 
 	if(!pWin->parent) {
-	    x = panoramiXdataPtr[scrnum].x;
-	    y = panoramiXdataPtr[scrnum].y;
+	    x = dixScreenOrigins[scrnum].x;
+	    y = dixScreenOrigins[scrnum].y;
 	    pWin = screenInfo.screens[0]->root;
 	    realWin = pWin->drawable.id;
 	} else if (scrnum) {
diff --git a/record/record.c b/record/record.c
index 3724dc7..b81b7b2 100644
--- a/record/record.c
+++ b/record/record.c
@@ -755,11 +755,11 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP,
 		int scr = XineramaGetCursorScreen(inputInfo.pointer);
 		memcpy(&shiftedEvent, pev, sizeof(xEvent));
 		shiftedEvent.u.keyButtonPointer.rootX +=
-		    panoramiXdataPtr[scr].x -
-		    panoramiXdataPtr[0].x;
+		    dixScreenOrigins[scr].x -
+		    dixScreenOrigins[0].x;
 		shiftedEvent.u.keyButtonPointer.rootY +=
-		    panoramiXdataPtr[scr].y -
-		    panoramiXdataPtr[0].y;
+		    dixScreenOrigins[scr].y -
+		    dixScreenOrigins[0].y;
 		pEvToRecord = &shiftedEvent;
 	    }
 #endif /* PANORAMIX */
diff --git a/render/render.c b/render/render.c
index d342502..11c0927 100644
--- a/render/render.c
+++ b/render/render.c
@@ -2832,22 +2832,22 @@ PanoramiXRenderComposite (ClientPtr client)
 	stuff->src = src->info[j].id;
 	if (src->u.pict.root)
 	{
-	    stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x;
-	    stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y;
+	    stuff->xSrc = orig.xSrc - dixScreenOrigins[j].x;
+	    stuff->ySrc = orig.ySrc - dixScreenOrigins[j].y;
 	}
 	stuff->dst = dst->info[j].id;
 	if (dst->u.pict.root)
 	{
-	    stuff->xDst = orig.xDst - panoramiXdataPtr[j].x;
-	    stuff->yDst = orig.yDst - panoramiXdataPtr[j].y;
+	    stuff->xDst = orig.xDst - dixScreenOrigins[j].x;
+	    stuff->yDst = orig.yDst - dixScreenOrigins[j].y;
 	}
 	if (msk)
 	{
 	    stuff->mask = msk->info[j].id;
 	    if (msk->u.pict.root)
 	    {
-		stuff->xMask = orig.xMask - panoramiXdataPtr[j].x;
-		stuff->yMask = orig.yMask - panoramiXdataPtr[j].y;
+		stuff->xMask = orig.xMask - dixScreenOrigins[j].x;
+		stuff->yMask = orig.yMask - dixScreenOrigins[j].y;
 	    }
 	}
 	result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client);
@@ -2881,14 +2881,14 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client)
 	    stuff->src = src->info[j].id;
 	    if (src->u.pict.root)
 	    {
-		stuff->xSrc = xSrc - panoramiXdataPtr[j].x;
-		stuff->ySrc = ySrc - panoramiXdataPtr[j].y;
+		stuff->xSrc = xSrc - dixScreenOrigins[j].x;
+		stuff->ySrc = ySrc - dixScreenOrigins[j].y;
 	    }
 	    stuff->dst = dst->info[j].id;
 	    if (dst->u.pict.root)
 	    {
-		elt->deltax = origElt.deltax - panoramiXdataPtr[j].x;
-		elt->deltay = origElt.deltay - panoramiXdataPtr[j].y;
+		elt->deltax = origElt.deltax - dixScreenOrigins[j].x;
+		elt->deltay = origElt.deltay - dixScreenOrigins[j].y;
 	    }
 	    result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client);
 	    if(result != Success) break;
@@ -2918,8 +2918,8 @@ PanoramiXRenderFillRectangles (ClientPtr client)
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root)
 	    {
-		int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
 		    xRectangle	*rects = (xRectangle *) (stuff + 1);
@@ -2966,8 +2966,8 @@ PanoramiXRenderTrapezoids(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-                int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
                     xTrapezoid  *trap = (xTrapezoid *) (stuff + 1);
@@ -3026,8 +3026,8 @@ PanoramiXRenderTriangles(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-                int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
                     xTriangle  *tri = (xTriangle *) (stuff + 1);
@@ -3082,8 +3082,8 @@ PanoramiXRenderTriStrip(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-                int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
                     xPointFixed  *fixed = (xPointFixed *) (stuff + 1);
@@ -3134,8 +3134,8 @@ PanoramiXRenderTriFan(ClientPtr client)
 	FOR_NSCREENS_FORWARD(j) {
 	    if (j) memcpy (stuff + 1, extra, extra_len);
 	    if (dst->u.pict.root) {
-                int x_off = panoramiXdataPtr[j].x;
-		int y_off = panoramiXdataPtr[j].y;
+		int x_off = dixScreenOrigins[j].x;
+		int y_off = dixScreenOrigins[j].y;
 
 		if(x_off || y_off) {
                     xPointFixed  *fixed = (xPointFixed *) (stuff + 1);
@@ -3188,8 +3188,8 @@ PanoramiXRenderAddTraps (ClientPtr client)
 	    
 	    if (picture->u.pict.root)
 	    {
-		stuff->xOff = x_off + panoramiXdataPtr[j].x;
-		stuff->yOff = y_off + panoramiXdataPtr[j].y;
+		stuff->xOff = x_off + dixScreenOrigins[j].x;
+		stuff->yOff = y_off + dixScreenOrigins[j].y;
 	    }
 	    result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
 	    if(result != Success) break;
commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 22 00:26:28 2010 -0700

    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 at minilop.net>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 594da0e..e1cef87 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -837,7 +837,7 @@ PanoramiXConsolidate(void)
 
     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;
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 08ea3ec..6b199cf 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -129,7 +129,7 @@ int PanoramiXCreateWindow(ClientPtr client)
     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;
@@ -328,7 +328,7 @@ int PanoramiXReparentWindow(ClientPtr client)
 
     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;
@@ -475,7 +475,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
 	}
     }
 
-    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) {
@@ -544,7 +544,7 @@ int PanoramiXGetGeometry(ClientPtr client)
     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;
@@ -562,7 +562,7 @@ int PanoramiXGetGeometry(ClientPtr client)
         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;
@@ -596,7 +596,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
     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;
@@ -634,7 +634,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
     }
     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;
diff --git a/Xext/saver.c b/Xext/saver.c
index da61fbe..696c4aa 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -503,7 +503,7 @@ SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
 	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;
@@ -580,7 +580,7 @@ CreateSaverWindow (ScreenPtr pScreen)
     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, 
@@ -866,7 +866,7 @@ ScreenSaverSetAttributes (ClientPtr client)
     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)
diff --git a/Xi/closedev.c b/Xi/closedev.c
index 159ead5..e319c73 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -156,7 +156,7 @@ ProcXCloseDevice(ClientPtr 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);
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 41b396c..56d9bf7 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -926,7 +926,7 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
         }
 
         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);
     }
@@ -1042,7 +1042,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
 
 	/* 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;
@@ -2120,7 +2120,7 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count)
     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);
diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c
index e72cfac..2153393 100644
--- a/Xi/xichangecursor.c
+++ b/Xi/xichangecursor.c
@@ -93,7 +93,7 @@ int ProcXIChangeCursor(ClientPtr client)
 
     if (stuff->cursor == None)
     {
-        if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
+        if (pWin == pWin->drawable.pScreen->root)
             pCursor = rootCursor;
         else
             pCursor = (CursorPtr)None;
diff --git a/composite/compinit.c b/composite/compinit.c
index a81cc74..e4b68c8 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -141,7 +141,7 @@ compScreenUpdate (ScreenPtr pScreen)
     compCheckTree (pScreen);
     if (cs->damaged)
     {
-	compWindowUpdate (WindowTable[pScreen->myNum]);
+	compWindowUpdate (pScreen->root);
 	cs->damaged = FALSE;
     }
 }
diff --git a/composite/compoverlay.c b/composite/compoverlay.c
index 2158cdb..67b566c 100644
--- a/composite/compoverlay.c
+++ b/composite/compoverlay.c
@@ -124,7 +124,7 @@ 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;
diff --git a/dix/devices.c b/dix/devices.c
index 250a498..998d22a 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -360,9 +360,9 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
             /* 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)
             {
@@ -2435,7 +2435,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
         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;
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 27cb220..c0efce5 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -562,7 +562,7 @@ CreateConnectionBlock(void)
 	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;
@@ -912,7 +912,7 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep)
     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;
@@ -972,7 +972,7 @@ ProcQueryTree(ClientPtr client)
         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;
@@ -2055,7 +2055,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
 	}
 	else
 	{
-	    pBoundingDraw = (DrawablePtr)WindowTable[pDraw->pScreen->myNum];
+	    pBoundingDraw = (DrawablePtr)pDraw->pScreen->root;
 	}
 
 	xgi.visual = wVisual (pWin);
@@ -3666,9 +3666,9 @@ SendConnSetup(ClientPtr client, char *reason)
     {
 	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++)
 	{
@@ -3916,7 +3916,6 @@ AddScreen(
        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))
diff --git a/dix/enterleave.c b/dix/enterleave.c
index c08cc31..eefa7ab 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -1077,7 +1077,7 @@ CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev,
 
     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
@@ -1138,7 +1138,7 @@ CoreFocusToPointerRootOrNone(DeviceIntPtr dev,
 
     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);
@@ -1169,7 +1169,7 @@ CoreFocusFromPointerRootOrNone(DeviceIntPtr dev,
 
     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
@@ -1279,7 +1279,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
                         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
         {
@@ -1293,7 +1293,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
         }
         /* 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);
     }
@@ -1305,7 +1305,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
                 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);
diff --git a/dix/events.c b/dix/events.c
index 9e05dc9..0186596 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -556,9 +556,10 @@ 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;
@@ -619,7 +620,7 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
         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);
 }
@@ -875,7 +876,7 @@ CheckVirtualMotion(
 #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
@@ -1123,7 +1124,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
 	 *  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;
@@ -1339,7 +1340,7 @@ playmore:
             }
             else
                 ConfineCursorToWindow(dev,
-                        WindowTable[dev->spriteInfo->sprite->hotPhys.pScreen->myNum],
+                        dev->spriteInfo->sprite->hotPhys.pScreen->root,
                         TRUE, FALSE);
             PostNewCursor(dev);
         }
@@ -1369,7 +1370,7 @@ ScreenRestructured (ScreenPtr pScreen)
         }
         else
             ConfineCursorToWindow(pDev,
-                    WindowTable[pDev->spriteInfo->sprite->hotPhys.pScreen->myNum],
+                    pDev->spriteInfo->sprite->hotPhys.pScreen->root,
                     TRUE, FALSE);
     }
 }
@@ -2766,7 +2767,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
             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;
             }
         }
 
@@ -2849,7 +2850,7 @@ WindowsRestructured(void)
 
 #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. */
@@ -2892,7 +2893,7 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
             } else
                 ConfineCursorToWindow(
                         pDev,
-                        WindowTable[pSprite->hotPhys.pScreen->myNum],
+                        pSprite->hotPhys.pScreen->root,
                         TRUE, FALSE);
 
         }
@@ -3051,7 +3052,7 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen)
 
     pSprite = pDev->spriteInfo->sprite;
 
-    win = WindowTable[pScreen->myNum];
+    win = pScreen->root;
 
     pSprite->hotPhys.pScreen = pScreen;
     pSprite->hot = pSprite->hotPhys;
@@ -3124,7 +3125,7 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
 		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)
@@ -3139,8 +3140,7 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
     } else
 #endif
     if (newScreen != pSprite->hotPhys.pScreen)
-	ConfineCursorToWindow(pDev, WindowTable[newScreen->myNum],
-                TRUE, FALSE);
+	ConfineCursorToWindow(pDev, newScreen->root, TRUE, FALSE);
 }
 
 #ifdef PANORAMIX
@@ -3215,7 +3215,7 @@ XineramaWarpPointer(ClientPtr client)
 
 	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;
 	}
@@ -3231,7 +3231,7 @@ XineramaWarpPointer(ClientPtr client)
     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;
 	}
diff --git a/dix/globals.c b/dix/globals.c
index c24a94f..28e7d07 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -83,8 +83,6 @@ 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;
 
diff --git a/dix/main.c b/dix/main.c
index 3e500ba..982fedd 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -249,7 +249,7 @@ int main(int argc, char *argv[], char *envp[])
 #endif
 
 	for (i = 0; i < screenInfo.numScreens; i++)
-	    InitRootWindow(WindowTable[i]);
+	    InitRootWindow(screenInfo.screens[i]->root);
 
         InitCoreDevices();
 	InitInput(argc, argv);
@@ -303,7 +303,8 @@ int main(int argc, char *argv[], char *envp[])
 
         CloseInput();
 
-        memset(WindowTable, 0, sizeof(WindowTable));
+	for (i = 0; i < screenInfo.numScreens; i++)
+	    screenInfo.screens[i]->root = NullWindow;
 	CloseDownDevices();
 	CloseDownEvents();
 
diff --git a/dix/window.c b/dix/window.c
index bdad749..71edd46 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -210,7 +210,7 @@ PrintWindowTree(void)
     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);
@@ -256,7 +256,7 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data)
 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 */
@@ -366,7 +366,7 @@ CreateRootWindow(ScreenPtr pScreen)
     pScreen->screensaver.ExternalScreenSaver = NULL;
     screenIsSaved = SCREEN_SAVER_OFF;
 
-    WindowTable[pScreen->myNum] = pWin;
+    pScreen->root = pWin;
 
     pWin->drawable.pScreen = pScreen;
     pWin->drawable.type = DRAWABLE_WINDOW;
@@ -1327,7 +1327,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
 	     */
 	    if ( cursorID == None)
 	    {
-		if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
+		if (pWin == pWin->drawable.pScreen->root)
 		    pCursor = rootCursor;
 		else
 		    pCursor = (CursorPtr) None;
@@ -2964,7 +2964,7 @@ HandleSaveSet(ClientPtr client)
 	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
 	{
@@ -3250,7 +3250,6 @@ SaveScreens(int on, int mode)
 static Bool
 TileScreenSaver(ScreenPtr pScreen, int kind)
 {
-    int i = pScreen->myNum;
     int j;
     int result;
     XID attributes[3];
@@ -3266,9 +3265,9 @@ TileScreenSaver(ScreenPtr pScreen, int kind)
     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:
@@ -3280,7 +3279,7 @@ TileScreenSaver(ScreenPtr pScreen, int kind)
 	}
 	break;
     case SCREEN_IS_BLACK:
-	attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel;
+	attributes[attri++] = pScreen->root->drawable.pScreen->blackPixel;
 	mask |= CWBackPixel;
 	break;
     }
@@ -3329,12 +3328,12 @@ TileScreenSaver(ScreenPtr pScreen, int kind)
 
     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);
diff --git a/fb/fb.h b/fb/fb.h
index 91c91ee..e2222a5 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -740,7 +740,7 @@ typedef struct {
 
 #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 ? \
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index c8e8dae..678f290 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -297,7 +297,7 @@ void dmxFlushPendingSyncs(void)
 void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
-    WindowPtr      pRoot     = WindowTable[pScreen->myNum];
+    WindowPtr      pRoot     = pScreen->root;
     WindowPtr      pChild;
     Bool           anyMarked = FALSE;
 
@@ -402,7 +402,7 @@ static void dmxConfigureScreenWindow(int idx,
 static void dmxConfigureRootWindow(int idx, int x, int y, int w, int h)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[idx];
-    WindowPtr      pRoot     = WindowTable[idx];
+    WindowPtr      pRoot     = screenInfo.screens[idx]->root;
 
     /* NOTE: Either this function or the ones that it calls must handle
      * the case where w == 0 || h == 0.  Currently, the functions that
@@ -437,7 +437,7 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[idx];
     ScreenPtr      pScreen   = screenInfo.screens[idx];
-    WindowPtr      pRoot     = WindowTable[idx];
+    WindowPtr      pRoot     = pScreen->root;
     WindowPtr      pChild;
     int            xoff;
     int            yoff;
@@ -458,7 +458,7 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y)
     XineramaReinitData(pScreen);
 
     /* Adjust each of the root window's children */
-    if (!idx) ReinitializeRootWindow(WindowTable[0], xoff, yoff);
+    if (!idx) ReinitializeRootWindow(screenInfo.screens[0]->root, xoff, yoff);
     pChild = pRoot->firstChild;
     while (pChild) {
 	/* Adjust child window's position */
@@ -634,7 +634,7 @@ int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs)
 	int   i;
 	for (i = 0; i < dmxNumScreens; i++) {
 	    ScreenPtr  pScreen = screenInfo.screens[i];
-	    WindowPtr  pChild  = WindowTable[i]->firstChild;
+	    WindowPtr  pChild  = pScreen->root->firstChild;
 	    while (pChild) {
 		/* Adjust child window's position */
 		pScreen->MoveWindow(pChild,
@@ -914,7 +914,7 @@ static void dmxBECreateResources(pointer value, XID id, RESTYPE type,
 static void dmxBECreateWindowTree(int idx)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[idx];
-    WindowPtr      pRoot     = WindowTable[idx];
+    WindowPtr      pRoot     = screenInfo.screens[idx]->root;
     dmxWinPrivPtr  pWinPriv  = DMX_GET_WINDOW_PRIV(pRoot);
     WindowPtr      pWin;
 
@@ -982,7 +982,7 @@ static void dmxBECreateWindowTree(int idx)
 static void dmxForceExposures(int idx)
 {
     ScreenPtr      pScreen   = screenInfo.screens[idx];
-    WindowPtr  pRoot     = WindowTable[idx];
+    WindowPtr  pRoot     = pScreen->root;
     Bool       anyMarked = FALSE;
     WindowPtr  pChild;
 
@@ -1510,7 +1510,7 @@ static void dmxBEDestroyScratchGCs(int scrnNum)
  *  destroy a window as well as all of it's children. */
 static void dmxBEDestroyWindowTree(int idx)
 {
-    WindowPtr  pWin   = WindowTable[idx];
+    WindowPtr  pWin   = screenInfo.screens[idx]->root;
     WindowPtr  pChild = pWin;
 
     while (1) {
diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c
index 9542efa..bf34169 100644
--- a/hw/dmx/input/dmxconsole.c
+++ b/hw/dmx/input/dmxconsole.c
@@ -204,7 +204,7 @@ static void dmxConsoleDrawWindows(pointer private)
     XUnionRectWithRegion(&rect, whole, whole);
     
     for (i = 0; i < dmxNumScreens; i++) {
-        WindowPtr     pRoot       = WindowTable[i];
+        WindowPtr     pRoot       = screenInfo.screens[i]->root;
         WindowPtr     pChild;
 
 #if DMX_WINDOW_DEBUG
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 1242be1..814fc1a 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -570,7 +570,7 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
     int i;
 
 #ifdef PANORAMIX
-    if (!noPanoramiXExtension && pWindow && pWindow->parent != WindowTable[0])
+    if (!noPanoramiXExtension && pWindow && pWindow->parent != screenInfo.screens[0]->root)
         return;
 #endif
 #if DMX_WINDOW_DEBUG
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 9d1b383..10df02d 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -95,7 +95,7 @@ KdOsFuncs	*kdOsFuncs;
 void
 KdSetRootClip (ScreenPtr pScreen, BOOL enable)
 {
-    WindowPtr	pWin = WindowTable[pScreen->myNum];
+    WindowPtr	pWin = pScreen->root;
     WindowPtr	pChild;
     Bool	WasViewable;
     Bool	anyMarked = FALSE;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index d4b9351..1aad2d1 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1062,7 +1062,7 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen)
 static void
 xf86SetRootClip (ScreenPtr pScreen, Bool enable)
 {
-    WindowPtr	pWin = WindowTable[pScreen->myNum];
+    WindowPtr	pWin = pScreen->root;
     WindowPtr	pChild;
     Bool	WasViewable = (Bool)(pWin->viewable);
     Bool	anyMarked = FALSE;
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 455a02c..77053b8 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -159,7 +159,7 @@ xf86RandRSetMode (ScreenPtr	    pScreen,
     int			oldmmHeight = pScreen->mmHeight;
     int			oldVirtualX = scrp->virtualX;
     int			oldVirtualY = scrp->virtualY;
-    WindowPtr		pRoot = WindowTable[pScreen->myNum];
+    WindowPtr		pRoot = pScreen->root;
     Bool		ret = TRUE;
 
     if (pRoot && scrp->vtSema)
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 2b33f25..efed677 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1881,7 +1881,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
 void
 xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
 {
-   DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
+   DrawablePtr root = &pScreen->root->drawable;
    ChangeGCVal pval[2];
    BoxPtr pbox = REGION_RECTS(clipboxes);
    int i, nbox = REGION_NUM_RECTS(clipboxes);
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 754fe37..4487628 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -347,7 +347,7 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
 	ev.type = XF86VidModeNotify + XF86VidModeEventBase;
 	ev.state = state;
 	ev.timestamp = currentTime.milliseconds;
-	ev.root = WindowTable[pScreen->myNum]->drawable.id;
+	ev.root = pScreen->root->drawable.id;
 	ev.kind = kind;
 	ev.forced = forced;
 	WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 77f7fe2..f7cea5e 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1187,7 +1187,7 @@ DRIDriverClipNotify(ScreenPtr pScreen)
 
 	if (pDRIPriv->nrWindows > 0) {
 	    pDRIPriv->nrWalked = 0;
-	    TraverseTree(WindowTable[pScreen->myNum], DRIDCNTreeTraversal,
+	    TraverseTree(pScreen->root, DRIDCNTreeTraversal,
 			 (pointer)pDRIWindows);
 	}
 
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 5562853..9ec4caa 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -607,7 +607,7 @@ DRI2CanFlip(DrawablePtr pDraw)
     if (pDraw->type == DRAWABLE_PIXMAP)
 	return TRUE;
 
-    pRoot = WindowTable[pScreen->myNum];
+    pRoot = pScreen->root;
     pRootPixmap = pScreen->GetWindowPixmap(pRoot);
 
     pWin = (WindowPtr) pDraw;
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 9dfce3f..8d598d6 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -517,7 +517,7 @@ xf86RandR12SetMode (ScreenPtr	    pScreen,
     int			oldHeight = pScreen->height;
     int			oldmmWidth = pScreen->mmWidth;
     int			oldmmHeight = pScreen->mmHeight;
-    WindowPtr		pRoot = WindowTable[pScreen->myNum];
+    WindowPtr		pRoot = pScreen->root;
     DisplayModePtr      currentMode = NULL;
     Bool 		ret = TRUE;
     PixmapPtr 		pspix = NULL;
@@ -685,7 +685,7 @@ xf86RandR12ScreenSetSize (ScreenPtr	pScreen,
     XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
     ScrnInfoPtr		pScrn = XF86SCRNINFO(pScreen);
     xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(pScrn);
-    WindowPtr		pRoot = WindowTable[pScreen->myNum];
+    WindowPtr		pRoot = pScreen->root;
     PixmapPtr		pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
     Bool		ret = FALSE;
     int                 c;
@@ -739,7 +739,7 @@ finish:
     if (pRoot && pScrn->vtSema)
 	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
 #if RANDR_12_INTERFACE
-    if (xf86RandR12Key && WindowTable[pScreen->myNum] && ret)
+    if (xf86RandR12Key && pScreen->root && ret)
 	RRScreenSizeNotify (pScreen);
 #endif
     return ret;
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 2714fee..e3683a8 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -76,9 +76,9 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
 {
     ScrnInfoPtr		scrn = crtc->scrn;
     ScreenPtr		screen = scrn->pScreen;
-    WindowPtr		root = WindowTable[screen->myNum];
+    WindowPtr		root = screen->root;
     PixmapPtr		dst_pixmap = crtc->rotatedPixmap;
-    PictFormatPtr	format = compWindowFormat (WindowTable[screen->myNum]);
+    PictFormatPtr	format = compWindowFormat (screen->root);
     int			error;
     PicturePtr		src, dst;
     int			n = REGION_NUM_RECTS(region);
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
index d37c8ec..d58db8e 100644
--- a/hw/xfree86/xaa/xaaCpyWin.c
+++ b/hw/xfree86/xaa/xaaCpyWin.c
@@ -47,7 +47,7 @@ XAACopyWindow(
     	return;
     }
 
-    pwinRoot = WindowTable[pScreen->myNum];
+    pwinRoot = pScreen->root;
 
     REGION_NULL(pScreen, &rgnDst);
 
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
index 2af8083..14de9bd 100644
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -54,7 +54,7 @@ XAACopyWindow8_32(
     	return;
     }
 
-    pwinRoot = WindowTable[pScreen->myNum];
+    pwinRoot = pScreen->root;
 
     if(doUnderlay)
 	freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
index 3b848ac..b186cb5 100644
--- a/hw/xfree86/xaa/xaaOverlayDF.c
+++ b/hw/xfree86/xaa/xaaOverlayDF.c
@@ -324,7 +324,7 @@ XAAOverCopyWindow(
     RegionRec rgnDst;
     BoxPtr pbox;
     int i, nbox, dx, dy;
-    WindowPtr pRoot = WindowTable[pScreen->myNum];
+    WindowPtr pRoot = pScreen->root;
 
 
     if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) { 
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 580fe4a..825afa0 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -793,7 +793,7 @@ void AbortDDX( void )
 void
 xf86SetRootClip (ScreenPtr pScreen, int enable)
 {
-    WindowPtr	pWin = WindowTable[pScreen->myNum];
+    WindowPtr	pWin = pScreen->root;
     WindowPtr	pChild;
     Bool	WasViewable = (Bool)(pWin->viewable);
     Bool	anyMarked = TRUE;
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 36d18eb..ac7fedd 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -276,7 +276,7 @@ void QuartzUpdateScreens(void) {
     sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
     
     /* Adjust the root window. */
-    pRoot = WindowTable[pScreen->myNum];
+    pRoot = pScreen->root;
     AppleWMSetScreenOrigin(pRoot);
     pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 53dde7a..6dc2c87 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -576,7 +576,7 @@ xprHideWindows(Bool hide)
     
     for (screen = 0; screen < screenInfo.numScreens; screen++) {
         RootlessFrameID prevWid = NULL;
-        pRoot = WindowTable[screenInfo.screens[screen]->myNum];
+        pRoot = screenInfo.screens[screen]->root;
 
         for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
             RootlessWindowRec *winRec = WINREC(pWin);
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index d574721..87e97d4 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -397,7 +397,7 @@ xprUpdateScreen(ScreenPtr pScreen)
     rootlessGlobalOffsetX = darwinMainScreenX;
     rootlessGlobalOffsetY = darwinMainScreenY;
 
-    AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
+    AppleWMSetScreenOrigin(pScreen->root);
 
     RootlessRepositionWindows(pScreen);
     RootlessUpdateScreenPixmap(pScreen);
@@ -416,7 +416,7 @@ xprInitInput(int argc, char **argv)
     rootlessGlobalOffsetY = darwinMainScreenY;
 
     for (i = 0; i < screenInfo.numScreens; i++)
-        AppleWMSetScreenOrigin(WindowTable[i]);
+        AppleWMSetScreenOrigin(screenInfo.screens[i]->root);
 }
 
 /*
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index ad9e66a..6d91ce0 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -262,7 +262,7 @@ winRestoreModeKeyStates (void)
 
   /* Only process events if the rootwindow is mapped. The keyboard events
    * will cause segfaults otherwise */
-  if (WindowTable && WindowTable[0] && WindowTable[0]->mapped == FALSE)
+  if (screenInfo.screens[0]->root && screenInfo.screens[0]->root->mapped == FALSE)
     processEvents = FALSE;    
   
   /* Force to process all pending events in the mi event queue */
diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
index 3a49ead..214e895 100755
--- a/hw/xwin/winwin32rootlesswindow.c
+++ b/hw/xwin/winwin32rootlesswindow.c
@@ -407,7 +407,7 @@ void
 winMWExtWMRestackWindows (ScreenPtr pScreen)
 {
   winScreenPriv(pScreen);
-  WindowPtr pRoot = WindowTable[pScreen->myNum];
+  WindowPtr pRoot = pScreen->root;
   WindowPtr pWin = NULL;
   WindowPtr pWinPrev = NULL;
   win32RootlessWindowPtr pRLWin = NULL;
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index d0c360f..9348d5c 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -144,7 +144,7 @@ winCopyWindowNativeGDI (WindowPtr pWin,
 #endif
 
   /* Get a pointer to the root window */
-  pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
+  pwinRoot = pWin->drawable.pScreen->root;
 
   /* Create a region for the destination */
   prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
diff --git a/include/globals.h b/include/globals.h
index 6959fc7..7de262f 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -19,7 +19,6 @@ 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;
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 1460bc4..f8171ca 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -478,6 +478,7 @@ typedef struct _Screen {
     pointer		devPrivate;
     short       	numVisuals;
     VisualPtr		visuals;
+    WindowPtr		root;
     ScreenSaverStuffRec screensaver;
 
     /* Random screen procedures */
diff --git a/mi/midispcur.c b/mi/midispcur.c
index c279010..87eb27d 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -405,7 +405,7 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
     }
     pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
 						  miDCScreenKey);
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
     pBuffer = MIDCBUFFER(pDev, pScreen);
 
 #ifdef ARGB_CURSOR
@@ -448,7 +448,7 @@ miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
     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)
@@ -482,7 +482,7 @@ miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
     pBuffer = MIDCBUFFER(pDev, pScreen);
     pSave = pBuffer->pSave;
 
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
     if (!pSave)
 	return FALSE;
 
@@ -513,7 +513,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
             goto failure;
 
         dixSetPrivate(&pDev->devPrivates, miDCSpriteKey + pScreen->myNum, pBuffer);
-        pWin = WindowTable[pScreen->myNum];
+        pWin = pScreen->root;
 
         pBuffer->pSourceGC = miDCMakeGC(pWin);
         if (!pBuffer->pSourceGC)
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 57968dd..9249ca9 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -426,7 +426,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
 	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;
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 1a3ac41..da3ff4a 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -306,7 +306,7 @@ 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);
     }	
 }
 
@@ -1610,7 +1610,7 @@ miOverlayChangeBorderWidth(
 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);
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 39a3eed..dd3f953 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -447,7 +447,7 @@ RootlessRedisplay(WindowPtr pWindow)
 void
 RootlessRepositionWindows(ScreenPtr pScreen)
 {
-    WindowPtr root = WindowTable[pScreen->myNum];
+    WindowPtr root = pScreen->root;
     WindowPtr win;
 
     if (root != NULL) {
@@ -468,7 +468,7 @@ RootlessRepositionWindows(ScreenPtr pScreen)
 void
 RootlessRedisplayScreen(ScreenPtr pScreen)
 {
-    WindowPtr root = WindowTable[pScreen->myNum];
+    WindowPtr root = pScreen->root;
 
     if (root != NULL) {
         WindowPtr win;
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index f44c4e8..8a4b813 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -213,7 +213,7 @@ extern RegionRec rootlessHugeRoot;
 
 // Returns TRUE if this window is a root window
 #define IsRoot(pWin) \
-    ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum])
+    ((pWin) == (pWin)->drawable.pScreen->root)
 
 
 /*
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 7a24af8..d24ca04 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -493,7 +493,7 @@ static void expose_1 (WindowPtr pWin) {
 void
 RootlessScreenExpose (ScreenPtr pScreen)
 {
-    expose_1 (WindowTable[pScreen->myNum]);
+    expose_1 (pScreen->root);
 }
 
 
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 22a548a..5955cd9 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1517,7 +1517,7 @@ RootlessOrderAllWindows (void)
     RL_DEBUG_MSG("RootlessOrderAllWindows() ");
     for (i = 0; i < screenInfo.numScreens; i++) {
       if (screenInfo.screens[i] == NULL) continue;
-      pWin = WindowTable[i];
+      pWin = screenInfo.screens[i]->root;
       if (pWin == NULL) continue;
       
       for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) {
@@ -1533,7 +1533,7 @@ void
 RootlessEnableRoot (ScreenPtr pScreen)
 {
     WindowPtr pRoot;
-    pRoot = WindowTable[pScreen->myNum];
+    pRoot = pScreen->root;
     
     RootlessEnsureFrame (pRoot);
     (*pScreen->ClearToBackground) (pRoot, 0, 0, 0, 0, TRUE);
@@ -1546,7 +1546,7 @@ RootlessDisableRoot (ScreenPtr pScreen)
     WindowPtr pRoot;
     RootlessWindowRec *winRec;
 
-    pRoot = WindowTable[pScreen->myNum];
+    pRoot = pScreen->root;
     winRec = WINREC (pRoot);
 
     if (NULL == winRec)
@@ -1572,8 +1572,10 @@ RootlessHideAllWindows (void)
     for (i = 0; i < screenInfo.numScreens; i++)
     {
         pScreen = screenInfo.screens[i];
-        pWin = WindowTable[i];
-        if (pScreen == NULL || pWin == NULL)
+	if (pScreen == NULL)
+	    continue;
+	pWin = pScreen->root;
+	if (pWin == NULL)
             continue;
         
         for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
@@ -1609,8 +1611,10 @@ RootlessShowAllWindows (void)
     for (i = 0; i < screenInfo.numScreens; i++)
     {
         pScreen = screenInfo.screens[i];
-        pWin = WindowTable[i];
-        if (pScreen == NULL || pWin == NULL)
+	if (pScreen == NULL)
+	    continue;
+	pWin = pScreen->root;
+	if (pWin == NULL)
             continue;
         
         for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index a940f8a..a2a0f36 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -73,7 +73,7 @@ RREditConnectionInfo (ScreenPtr pScreen)
 void
 RRSendConfigNotify (ScreenPtr pScreen)
 {
-    WindowPtr	pWin = WindowTable[pScreen->myNum];
+    WindowPtr	pWin = pScreen->root;
     xEvent	event;
 
     event.u.u.type = ConfigureNotify;
@@ -97,7 +97,7 @@ 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);
@@ -620,7 +620,7 @@ ProcRRGetScreenInfo (ClientPtr client)
 	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;
@@ -649,7 +649,7 @@ ProcRRGetScreenInfo (ClientPtr client)
 	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;
@@ -961,7 +961,7 @@ sendReply:
 
     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) 
     {
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 457b2b4..c1bd5bb 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -216,7 +216,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
 	return rc;
 
     pScreen = pWin->drawable.pScreen;
-    pRoot = WindowTable[pScreen->myNum];
+    pRoot = pScreen->root;
     
     rep.type = X_Reply;
     rep.length = 0;
diff --git a/render/render.c b/render/render.c
index b58dd3e..d342502 100644
--- a/render/render.c
+++ b/render/render.c
@@ -2681,7 +2681,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
     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;
     }
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index d3a207d..5f08db7 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -690,7 +690,7 @@ ReplaceCursor (CursorPtr pCursor,
 	}
     }
     /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */
-    WindowHasNewCursor (WindowTable[0]);
+    WindowHasNewCursor (screenInfo.screens[0]->root);
 }
 
 static Bool 
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 93175c5..0f3ffa4 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -43,6 +43,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "inputstr.h"
 #include "opaque.h"
 #include "property.h"
+#include "scrnintstr.h"
 #define	XKBSRV_NEED_FILE_FUNCS
 #include <xkbsrv.h>
 #include "xkbgeom.h"
@@ -210,7 +211,7 @@ char *			pval;
 	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;
commit 80b5d3a3264d2c5167e5ac85a3b04af0f89cece1
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri May 21 23:13:51 2010 -0700

    Move each screen's screensaver data into ScreenRec.
    
    Most references to the savedScreenInfo array already had the
    corresponding screen pointer handy, which meant they usually looked like
    "savedScreenInfo[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.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com> (i686 GNU/Linux)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index edcbb49..594da0e 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -836,13 +836,14 @@ PanoramiXConsolidate(void)
     saver->type = XRT_WINDOW;
 
     for (i =  0; i < PanoramiXNumScreens; i++) {
+	ScreenPtr pScreen = screenInfo.screens[i];
 	root->info[i].id = WindowTable[i]->drawable.id;
 	root->u.win.class = InputOutput;
         root->u.win.root = TRUE;
-        saver->info[i].id = savedScreenInfo[i].wid;
+        saver->info[i].id = pScreen->screensaver.wid;
         saver->u.win.class = InputOutput;
         saver->u.win.root = TRUE;
-	defmap->info[i].id = (screenInfo.screens[i])->defColormap;
+	defmap->info[i].id = pScreen->defColormap;
     }
 
     AddResource(root->info[0].id, XRT_WINDOW, root);
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 8752ca5..08ea3ec 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -130,7 +130,7 @@ int PanoramiXCreateWindow(ClientPtr client)
     orig_x = stuff->x;
     orig_y = stuff->y;
     parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
-                   (stuff->parent == savedScreenInfo[0].wid);
+                   (stuff->parent == screenInfo.screens[0]->screensaver.wid);
     FOR_NSCREENS_BACKWARD(j) {
         stuff->wid = newWin->info[j].id;
         stuff->parent = parent->info[j].id;
@@ -329,7 +329,7 @@ int PanoramiXReparentWindow(ClientPtr client)
     x = stuff->x;
     y = stuff->y;
     parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
-                   (stuff->parent == savedScreenInfo[0].wid);
+                   (stuff->parent == screenInfo.screens[0]->screensaver.wid);
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->window = win->info[j].id;
 	stuff->parent = parent->info[j].id;
@@ -476,7 +476,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
     }
 
     if(pWin->parent && ((pWin->parent == WindowTable[0]) ||
-                        (pWin->parent->drawable.id == savedScreenInfo[0].wid)))
+                        (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid)))
     {
 	if ((Mask)stuff->mask & CWX) {
 	    x_offset = 0;
@@ -563,7 +563,7 @@ int PanoramiXGetGeometry(ClientPtr client)
 	rep.x = pWin->origin.x - wBorderWidth (pWin);
 	rep.y = pWin->origin.y - wBorderWidth (pWin);
 	if((pWin->parent == WindowTable[0]) || 
-           (pWin->parent->drawable.id == savedScreenInfo[0].wid))
+           (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid))
         {
 	   rep.x += panoramiXdataPtr[0].x;
 	   rep.y += panoramiXdataPtr[0].y;
@@ -597,7 +597,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
     rep.child = None;
 
     if((pWin == WindowTable[0]) || 
-       (pWin->drawable.id == savedScreenInfo[0].wid))
+       (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
     { 
 	x = stuff->srcX - panoramiXdataPtr[0].x;
 	y = stuff->srcY - panoramiXdataPtr[0].y;
@@ -635,7 +635,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
     rep.dstX = x - pDst->drawable.x;
     rep.dstY = y - pDst->drawable.y;
     if((pDst == WindowTable[0]) || 
-       (pDst->drawable.id == savedScreenInfo[0].wid))
+       (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 fdcbac5..da61fbe 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -285,7 +285,7 @@ CheckScreenPrivate (ScreenPtr pScreen)
     {
 	free(pPriv);
 	SetScreenPrivate (pScreen, NULL);
-	savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
+	pScreen->screensaver.ExternalScreenSaver = NULL;
     }
 }
 
@@ -304,7 +304,7 @@ MakeScreenPrivate (ScreenPtr pScreen)
     pPriv->hasWindow = FALSE;
     pPriv->installedMap = None;
     SetScreenPrivate (pScreen, pPriv);
-    savedScreenInfo[pScreen->myNum].ExternalScreenSaver = ScreenSaverHandle;
+    pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle;
     return pPriv;
 }
 
@@ -504,7 +504,7 @@ SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
 	ev.state = state;
 	ev.timestamp = currentTime.milliseconds;
 	ev.root = WindowTable[pScreen->myNum]->drawable.id;
-	ev.window = savedScreenInfo[pScreen->myNum].wid;
+	ev.window = pScreen->screensaver.wid;
 	ev.kind = kind;
 	ev.forced = forced;
 	WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
@@ -559,7 +559,7 @@ CreateSaverWindow (ScreenPtr pScreen)
     Colormap			wantMap;
     ColormapPtr			pCmap;
 
-    pSaver = &savedScreenInfo[pScreen->myNum];
+    pSaver = &pScreen->screensaver;
     if (pSaver->pWindow)
     {
 	pSaver->pWindow = NullWindow;
@@ -672,7 +672,7 @@ DestroySaverWindow (ScreenPtr pScreen)
     if (!pPriv || !pPriv->hasWindow)
 	return FALSE;
 
-    pSaver = &savedScreenInfo[pScreen->myNum];
+    pSaver = &pScreen->screensaver;
     if (pSaver->pWindow)
     {
 	pSaver->pWindow = NullWindow;
@@ -756,7 +756,7 @@ ProcScreenSaverQueryInfo (ClientPtr client)
     if (rc != Success)
 	return rc;
 
-    pSaver = &savedScreenInfo[pDraw->pScreen->myNum];
+    pSaver = &pDraw->pScreen->screensaver;
     pPriv = GetScreenPrivate (pDraw->pScreen);
 
     UpdateCurrentTime ();
diff --git a/composite/compwindow.c b/composite/compwindow.c
index f2f6ea3..3b16bf9 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -800,7 +800,7 @@ CompositeRealChildHead (WindowPtr pWin)
 
     if (!pWin->parent &&
 	(screenIsSaved == SCREEN_SAVER_ON) &&
-	(HasSaverWindow (pWin->drawable.pScreen->myNum))) {
+	(HasSaverWindow (pWin->drawable.pScreen))) {
 
 	/* First child is the screen saver; see if next child is the overlay */
 	pChildBefore = pWin->firstChild;
diff --git a/dix/window.c b/dix/window.c
index 00854c6..bdad749 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -151,12 +151,10 @@ WindowSeekDeviceCursor(WindowPtr pWin,
 
 int screenIsSaved = SCREEN_SAVER_OFF;
 
-ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
-
 static int FocusPrivatesKeyIndex;
 DevPrivateKey FocusPrivatesKey = &FocusPrivatesKeyIndex;
 
-static Bool TileScreenSaver(int i, int kind);
+static Bool TileScreenSaver(ScreenPtr pScreen, int kind);
 
 
 #define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
@@ -363,9 +361,9 @@ CreateRootWindow(ScreenPtr pScreen)
     if (!pWin)
 	return FALSE;
 
-    savedScreenInfo[pScreen->myNum].pWindow = NULL;
-    savedScreenInfo[pScreen->myNum].wid = FakeClientID(0);
-    savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
+    pScreen->screensaver.pWindow = NULL;
+    pScreen->screensaver.wid = FakeClientID(0);
+    pScreen->screensaver.ExternalScreenSaver = NULL;
     screenIsSaved = SCREEN_SAVER_OFF;
 
     WindowTable[pScreen->myNum] = pWin;
@@ -539,7 +537,7 @@ RealChildHead(WindowPtr pWin)
 
     if (!pWin->parent &&
 	(screenIsSaved == SCREEN_SAVER_ON) &&
-	(HasSaverWindow (pWin->drawable.pScreen->myNum)))
+	(HasSaverWindow (pWin->drawable.pScreen)))
 	return (pWin->firstChild);
     else
 	return (NullWindow);
@@ -3034,7 +3032,7 @@ NotClippedByChildren(WindowPtr pWin)
     pReg = REGION_CREATE(pScreen, NullBox, 1);
     if (pWin->parent ||
 	screenIsSaved != SCREEN_SAVER_ON ||
-	!HasSaverWindow (pWin->drawable.pScreen->myNum))
+	!HasSaverWindow (pWin->drawable.pScreen))
     {
 	REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize);
     }
@@ -3152,33 +3150,33 @@ dixSaveScreens(ClientPtr client, int on, int mode)
     }
     for (i = 0; i < screenInfo.numScreens; i++)
     {
+	ScreenPtr pScreen = screenInfo.screens[i];
 	if (on == SCREEN_SAVER_FORCER)
-	   (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], on);
-	if (savedScreenInfo[i].ExternalScreenSaver)
+	   (* pScreen->SaveScreen) (pScreen, on);
+	if (pScreen->screensaver.ExternalScreenSaver)
 	{
-	    if ((*savedScreenInfo[i].ExternalScreenSaver)
-		(screenInfo.screens[i], type, on == SCREEN_SAVER_FORCER))
+	    if ((*pScreen->screensaver.ExternalScreenSaver)
+		(pScreen, type, on == SCREEN_SAVER_FORCER))
 		continue;
 	}
 	if (type == screenIsSaved)
 	    continue;
 	switch (type) {
 	case SCREEN_SAVER_OFF:
-	    if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED)
+	    if (pScreen->screensaver.blanked == SCREEN_IS_BLANKED)
 	    {
-	       (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i],
-						      what);
+	       (* pScreen->SaveScreen) (pScreen, what);
 	    }
-	    else if (HasSaverWindow (i))
+	    else if (HasSaverWindow (pScreen))
 	    {
-		savedScreenInfo[i].pWindow = NullWindow;
-		FreeResource(savedScreenInfo[i].wid, RT_NONE);
+		pScreen->screensaver.pWindow = NullWindow;
+		FreeResource(pScreen->screensaver.wid, RT_NONE);
 	    }
 	    break;
 	case SCREEN_SAVER_CYCLE:
-	    if (savedScreenInfo[i].blanked == SCREEN_IS_TILED)
+	    if (pScreen->screensaver.blanked == SCREEN_IS_TILED)
 	    {
-		WindowPtr pWin = savedScreenInfo[i].pWindow;
+		WindowPtr pWin = pScreen->screensaver.pWindow;
 		/* make it look like screen saver is off, so that
 		 * NotClippedByChildren will compute a clip list
 		 * for the root window, so miPaintWindow works
@@ -3202,35 +3200,33 @@ dixSaveScreens(ClientPtr client, int on, int mode)
 	     * Call the DDX saver in case it wants to do something
 	     * at cycle time
 	     */
-	    else if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED)
+	    else if (pScreen->screensaver.blanked == SCREEN_IS_BLANKED)
 	    {
-		(* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i],
-						       type);
+		(* pScreen->SaveScreen) (pScreen, type);
 	    }
 	    break;
 	case SCREEN_SAVER_ON:
 	    if (ScreenSaverBlanking != DontPreferBlanking)
 	    {
-		if ((* screenInfo.screens[i]->SaveScreen)
-		   (screenInfo.screens[i], what))
+		if ((* pScreen->SaveScreen) (pScreen, what))
 		{
-		   savedScreenInfo[i].blanked = SCREEN_IS_BLANKED;
+		   pScreen->screensaver.blanked = SCREEN_IS_BLANKED;
 		   continue;
 		}
 		if ((ScreenSaverAllowExposures != DontAllowExposures) &&
-		    TileScreenSaver(i, SCREEN_IS_BLACK))
+		    TileScreenSaver(pScreen, SCREEN_IS_BLACK))
 		{
-		    savedScreenInfo[i].blanked = SCREEN_IS_BLACK;
+		    pScreen->screensaver.blanked = SCREEN_IS_BLACK;
 		    continue;
 		}
 	    }
 	    if ((ScreenSaverAllowExposures != DontAllowExposures) &&
-		TileScreenSaver(i, SCREEN_IS_TILED))
+		TileScreenSaver(pScreen, SCREEN_IS_TILED))
 	    {
-		savedScreenInfo[i].blanked = SCREEN_IS_TILED;
+		pScreen->screensaver.blanked = SCREEN_IS_TILED;
 	    }
 	    else
-		savedScreenInfo[i].blanked = SCREEN_ISNT_SAVED;
+		pScreen->screensaver.blanked = SCREEN_ISNT_SAVED;
 	    break;
 	}
     }
@@ -3252,8 +3248,9 @@ SaveScreens(int on, int mode)
 }
 
 static Bool
-TileScreenSaver(int i, int kind)
+TileScreenSaver(ScreenPtr pScreen, int kind)
 {
+    int i = pScreen->myNum;
     int j;
     int result;
     XID attributes[3];
@@ -3330,12 +3327,12 @@ TileScreenSaver(int i, int kind)
 	}
     }
 
-    pWin = savedScreenInfo[i].pWindow =
-	 CreateWindow(savedScreenInfo[i].wid,
+    pWin = pScreen->screensaver.pWindow =
+	 CreateWindow(pScreen->screensaver.wid,
 	      WindowTable[i],
 	      -RANDOM_WIDTH, -RANDOM_WIDTH,
-	      (unsigned short)screenInfo.screens[i]->width + RANDOM_WIDTH,
-	      (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH,
+	      (unsigned short)pScreen->width + RANDOM_WIDTH,
+	      (unsigned short)pScreen->height + RANDOM_WIDTH,
 	      0, InputOutput, mask, attributes, 0, serverClient,
 	      wVisual (WindowTable[i]), &result);
 
@@ -3346,7 +3343,7 @@ TileScreenSaver(int i, int kind)
 	return FALSE;
 
     if (!AddResource(pWin->drawable.id, RT_WINDOW,
-		     (pointer)savedScreenInfo[i].pWindow))
+		     (pointer)pScreen->screensaver.pWindow))
 	return FALSE;
 
     if (mask & CWBackPixmap)
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 21b4a16..1460bc4 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -82,6 +82,16 @@ typedef struct _Depth {
     VisualID		*vids;    /* block of visual ids for this depth */
   } DepthRec;
 
+typedef struct _ScreenSaverStuff {
+    WindowPtr pWindow;
+    XID       wid;
+    char      blanked;
+    Bool      (*ExternalScreenSaver)(
+	ScreenPtr	/*pScreen*/,
+	int		/*xstate*/,
+	Bool		/*force*/);
+} ScreenSaverStuffRec;
+
 
 /*
  *  There is a typedef for each screen function pointer so that code that
@@ -468,6 +478,7 @@ typedef struct _Screen {
     pointer		devPrivate;
     short       	numVisuals;
     VisualPtr		visuals;
+    ScreenSaverStuffRec screensaver;
 
     /* Random screen procedures */
 
diff --git a/include/windowstr.h b/include/windowstr.h
index 96bee9b..29b95fc 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -204,24 +204,15 @@ extern _X_EXPORT Mask	DontPropagateMasks[];
 
 #define HasBorder(w)	((w)->borderWidth || wClipShape(w))
 
-typedef struct _ScreenSaverStuff {
-    WindowPtr pWindow;
-    XID       wid;
-    char      blanked;
-    Bool      (*ExternalScreenSaver)(
-	ScreenPtr	/*pScreen*/,
-	int		/*xstate*/,
-	Bool		/*force*/);
-} ScreenSaverStuffRec, *ScreenSaverStuffPtr;
+typedef struct _ScreenSaverStuff *ScreenSaverStuffPtr;
 
 #define SCREEN_IS_BLANKED   0
 #define SCREEN_ISNT_SAVED   1
 #define SCREEN_IS_TILED     2
 #define SCREEN_IS_BLACK	    3
 
-#define HasSaverWindow(i)   (savedScreenInfo[i].pWindow != NullWindow)
+#define HasSaverWindow(pScreen)   (pScreen->screensaver.pWindow != NullWindow)
 
 extern _X_EXPORT int screenIsSaved;
-extern _X_EXPORT ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
 
 #endif /* WINDOWSTRUCT_H */
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index df43196..1a3ac41 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -1741,7 +1741,7 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin)
 	pregWin = REGION_CREATE(pScreen, NullBox, 1);
 	freeTmpClip = TRUE;
 	if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) ||
-		!HasSaverWindow (pScreen->myNum))
+		!HasSaverWindow (pScreen))
 	{
             REGION_INTERSECT(pScreen,pregWin,&pTree->borderClip,&pWin->winSize);
 	}
commit 5030540d6cd2aa9bbd4ecb7f4487616f9ef0140a
Author: Jamey Sharp <jamey at minilop.net>
Date:   Thu May 27 11:50:52 2010 -0700

    midispcur: Add comment explaining why pRootPicture must not be freed.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Cc: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/mi/midispcur.c b/mi/midispcur.c
index 59923c8..c279010 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -569,6 +569,12 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
                 if (pBuffer->pSaveGC) FreeGC(pBuffer->pSaveGC, (GContext) 0);
                 if (pBuffer->pRestoreGC) FreeGC(pBuffer->pRestoreGC, (GContext) 0);
 
+#ifdef ARGB_CURSOR
+                /* If a pRootPicture was allocated for a root window, it
+                 * is freed when that root window is destroyed, so don't
+                 * free it again here. */
+#endif
+
                 if (pBuffer->pSave) (*pScreen->DestroyPixmap)(pBuffer->pSave);
 
                 free(pBuffer);
commit f308cbea8c9fa5c5c6705bc301178b167de450d5
Author: Jamey Sharp <jamey at minilop.net>
Date:   Mon May 24 18:41:54 2010 -0700

    mi: Delete unused flicker-free MoveCursor code.
    
    It's been commented-out for three and a half years and nobody seems to
    be missing it enough to resurrect it.
    
    Besides deleting code that is untested and therefore buggy, this saves a
    little memory for each pointer device on each screen.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/mi/midispcur.c b/mi/midispcur.c
index f2b2229..59923c8 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -66,12 +66,9 @@ static DevPrivateKey miDCSpriteKey = miDCSpriteKeyIndex;
 typedef struct {
     GCPtr	    pSourceGC, pMaskGC;
     GCPtr	    pSaveGC, pRestoreGC;
-    GCPtr	    pMoveGC;
-    GCPtr	    pPixSourceGC, pPixMaskGC;
-    PixmapPtr	    pSave, pTemp;
+    PixmapPtr	    pSave;
 #ifdef ARGB_CURSOR
     PicturePtr	    pRootPicture;
-    PicturePtr	    pTempPicture;
 #endif
 } miDCBufferRec, *miDCBufferPtr;
 
@@ -498,243 +495,10 @@ miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
 }
 
 Bool
-miDCChangeSave (DeviceIntPtr pDev, ScreenPtr pScreen,
-                int x, int y, int w, int h, int dx, int dy)
-{
-    miDCScreenPtr   pScreenPriv;
-    miDCBufferPtr   pBuffer;
-    PixmapPtr	    pSave;
-    WindowPtr	    pWin;
-    GCPtr	    pGC;
-    int		    sourcex, sourcey, destx, desty, copyw, copyh;
-
-    pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
-						  miDCScreenKey);
-    pBuffer = MIDCBUFFER(pDev, pScreen);
-
-    pSave = pBuffer->pSave;
-    pWin = WindowTable[pScreen->myNum];
-    /*
-     * restore the bits which are about to get trashed
-     */
-    if (!pSave)
-	return FALSE;
-
-    pGC = pBuffer->pRestoreGC;
-    if (pWin->drawable.serialNumber != pGC->serialNumber)
-	ValidateGC ((DrawablePtr) pWin, pGC);
-    /*
-     * copy the old bits to the screen.
-     */
-    if (dy > 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
-			       0, h - dy, w, dy, x + dx, y + h);
-    }
-    else if (dy < 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
-			       0, 0, w, -dy, x + dx, y + dy);
-    }
-    if (dy >= 0)
-    {
-	desty = y + dy;
-	sourcey = 0;
-	copyh = h - dy;
-    }
-    else
-    {
-	desty = y;
-	sourcey = - dy;
-	copyh = h + dy;
-    }
-    if (dx > 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
-			       w - dx, sourcey, dx, copyh, x + w, desty);
-    }
-    else if (dx < 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
-			       0, sourcey, -dx, copyh, x + dx, desty);
-    }
-
-    pGC = pBuffer->pSaveGC;
-    if (pSave->drawable.serialNumber != pGC->serialNumber)
-	ValidateGC ((DrawablePtr) pSave, pGC);
-    /*
-     * move the bits that are still valid within the pixmap
-     */
-    if (dx >= 0)
-    {
-	sourcex = 0;
-	destx = dx;
-	copyw = w - dx;
-    }
-    else
-    {
-	destx = 0;
-	sourcex = - dx;
-	copyw = w + dx;
-    }
-    if (dy >= 0)
-    {
-	sourcey = 0;
-	desty = dy;
-	copyh = h - dy;
-    }
-    else
-    {
-	desty = 0;
-	sourcey = -dy;
-	copyh = h + dy;
-    }
-    (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pSave, pGC,
-			   sourcex, sourcey, copyw, copyh, destx, desty);
-    /*
-     * copy the new bits from the screen into the remaining areas of the
-     * pixmap
-     */
-    if (dy > 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
-			       x, y, w, dy, 0, 0);
-    }
-    else if (dy < 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
-			       x, y + h + dy, w, -dy, 0, h + dy);
-    }
-    if (dy >= 0)
-    {
-	desty = dy;
-	sourcey = y + dy;
-	copyh = h - dy;
-    }
-    else
-    {
-	desty = 0;
-	sourcey = y;
-	copyh = h + dy;
-    }
-    if (dx > 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
-			       x, sourcey, dx, copyh, 0, desty);
-    }
-    else if (dx < 0)
-    {
-	(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
-			       x + w + dx, sourcey, -dx, copyh, w + dx, desty);
-    }
-    return TRUE;
-}
-
-Bool
-miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
-                int x, int y, int w, int h, int dx, int dy,
-                unsigned long source, unsigned long mask)
-{
-    miDCCursorPtr   pPriv;
-    miDCScreenPtr   pScreenPriv;
-    miDCBufferPtr   pBuffer;
-    int		    status;
-    WindowPtr	    pWin;
-    GCPtr	    pGC;
-    XID		    gcval = FALSE;
-    PixmapPtr	    pTemp;
-
-    pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
-					    CursorScreenKey(pScreen));
-    if (!pPriv)
-    {
-	pPriv = miDCRealize(pScreen, pCursor);
-	if (!pPriv)
-	    return FALSE;
-    }
-    pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
-						  miDCScreenKey);
-    pWin = WindowTable[pScreen->myNum];
-    pBuffer = MIDCBUFFER(pDev, pScreen);
-
-    pTemp = pBuffer->pTemp;
-    if (!pTemp ||
-	pTemp->drawable.width != pBuffer->pSave->drawable.width ||
-	pTemp->drawable.height != pBuffer->pSave->drawable.height)
-    {
-	if (pTemp)
-	    (*pScreen->DestroyPixmap) (pTemp);
-#ifdef ARGB_CURSOR
-	if (pBuffer->pTempPicture)
-	{
-	    FreePicture (pBuffer->pTempPicture, 0);
-	    pBuffer->pTempPicture = 0;
-	}
-#endif
-	pBuffer->pTemp = pTemp = (*pScreen->CreatePixmap)
-	    (pScreen, w, h, pBuffer->pSave->drawable.depth, 0);
-	if (!pTemp)
-	    return FALSE;
-    }
-    if (!pBuffer->pMoveGC)
-    {
-	pBuffer->pMoveGC = CreateGC ((DrawablePtr)pTemp,
-	    GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
-	if (!pBuffer->pMoveGC)
-	    return FALSE;
-    }
-    /*
-     * copy the saved area to a temporary pixmap
-     */
-    pGC = pBuffer->pMoveGC;
-    if (pGC->serialNumber != pTemp->drawable.serialNumber)
-	ValidateGC ((DrawablePtr) pTemp, pGC);
-    (*pGC->ops->CopyArea)((DrawablePtr)pBuffer->pSave,
-			  (DrawablePtr)pTemp, pGC, 0, 0, w, h, 0, 0);
-    
-    /*
-     * draw the cursor in the temporary pixmap
-     */
-#ifdef ARGB_CURSOR
-    if (pPriv->pPicture)
-    {
-	if (!EnsurePicture(pBuffer->pTempPicture, &pTemp->drawable, pWin))
-	    return FALSE;
-	CompositePicture (PictOpOver,
-			  pPriv->pPicture,
-			  NULL,
-			  pBuffer->pTempPicture,
-			  0, 0, 0, 0, 
-			  dx, dy, 
-			  pCursor->bits->width,
-			  pCursor->bits->height);
-    }
-    else
-#endif
-    {
-	miDCPutBits ((DrawablePtr)pTemp, pPriv,
-		     pBuffer->pPixSourceGC, pBuffer->pPixMaskGC,
-		     dx, dy, pCursor->bits->width, pCursor->bits->height,
-		     source, mask);
-    }
-
-    pGC = pBuffer->pRestoreGC;
-    if (pWin->drawable.serialNumber != pGC->serialNumber)
-	ValidateGC ((DrawablePtr) pWin, pGC);
-
-    (*pGC->ops->CopyArea) ((DrawablePtr) pTemp, (DrawablePtr) pWin,
-			    pGC,
-			    0, 0, w, h, x, y);
-    return TRUE;
-}
-
-Bool
 miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
     miDCBufferPtr   pBuffer;
     WindowPtr       pWin;
-    XID             gcval = FALSE;
-    int             status;
     int             i;
 
     if (!DevHasCursor(pDev))
@@ -767,28 +531,12 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
         if (!pBuffer->pRestoreGC)
             goto failure;
 
-        pBuffer->pMoveGC = CreateGC ((DrawablePtr)pWin,
-            GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
-        if (!pBuffer->pMoveGC)
-            goto failure;
-
-        pBuffer->pPixSourceGC = CreateGC ((DrawablePtr)pWin,
-            GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
-        if (!pBuffer->pPixSourceGC)
-            goto failure;
-
-        pBuffer->pPixMaskGC = CreateGC ((DrawablePtr)pWin,
-            GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
-        if (!pBuffer->pPixMaskGC)
-            goto failure;
-
 #ifdef ARGB_CURSOR
         pBuffer->pRootPicture = NULL;
-        pBuffer->pTempPicture = NULL;
 #endif
 
-        // these get (re)allocated lazily depending on the cursor size
-        pBuffer->pSave = pBuffer->pTemp = NULL;
+        /* (re)allocated lazily depending on the cursor size */
+        pBuffer->pSave = NULL;
     }
 
     return TRUE;
@@ -820,12 +568,8 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
                 if (pBuffer->pMaskGC) FreeGC(pBuffer->pMaskGC, (GContext) 0);
                 if (pBuffer->pSaveGC) FreeGC(pBuffer->pSaveGC, (GContext) 0);
                 if (pBuffer->pRestoreGC) FreeGC(pBuffer->pRestoreGC, (GContext) 0);
-                if (pBuffer->pMoveGC) FreeGC(pBuffer->pMoveGC, (GContext) 0);
-                if (pBuffer->pPixSourceGC) FreeGC(pBuffer->pPixSourceGC, (GContext) 0);
-                if (pBuffer->pPixMaskGC) FreeGC(pBuffer->pPixMaskGC, (GContext) 0);
 
                 if (pBuffer->pSave) (*pScreen->DestroyPixmap)(pBuffer->pSave);
-                if (pBuffer->pTemp) (*pScreen->DestroyPixmap)(pBuffer->pTemp);
 
                 free(pBuffer);
                 dixSetPrivate(&pDev->devPrivates, miDCSpriteKey + pScreen->myNum, NULL);
diff --git a/mi/misprite.c b/mi/misprite.c
index 3d10bc8..2962abf 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -798,73 +798,9 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
 	miSpriteFindColors (pPointer, pScreen);
     }
     if (pPointer->isUp) {
-#if 0
-        /* FIXME: Disabled for MPX, should be rewritten */
-	int	sx, sy;
-	/*
-	 * check to see if the old saved region
-	 * encloses the new sprite, in which case we use
-	 * the flicker-free MoveCursor primitive.
-	 */
-	sx = pointer->x - (int)pCursor->bits->xhot;
-	sy = pointer->y - (int)pCursor->bits->yhot;
-	if (sx + (int) pCursor->bits->width >= pointer->saved.x1 &&
-	    sx < pointer->saved.x2 &&
-	    sy + (int) pCursor->bits->height >= pointer->saved.y1 &&
-	    sy < pointer->saved.y2 &&
-	    (int) pCursor->bits->width + (2 * SPRITE_PAD) ==
-		pointer->saved.x2 - pointer->saved.x1 &&
-	    (int) pCursor->bits->height + (2 * SPRITE_PAD) ==
-		pointer->saved.y2 - pointer->saved.y1
-	    )
-	{
-	    DamageDrawInternal (pScreen, TRUE);
-	    miSpriteIsDown(pCursorInfo);
-	    if (!(sx >= pointer->saved.x1 &&
-                  sx + (int)pCursor->bits->width < pointer->saved.x2
-                  && sy >= pointer->saved.y1 &&
-                  sy + (int)pCursor->bits->height <
-                                pointer->saved.y2))
-            {
-		int oldx1, oldy1, dx, dy;
-
-		oldx1 = pointer->saved.x1;
-		oldy1 = pointer->saved.y1;
-		dx = oldx1 - (sx - SPRITE_PAD);
-		dy = oldy1 - (sy - SPRITE_PAD);
-		pointer->saved.x1 -= dx;
-		pointer->saved.y1 -= dy;
-		pointer->saved.x2 -= dx;
-		pointer->saved.y2 -= dy;
-		(void) miDCChangeSave(pScreen,
-				pointer->saved.x1,
- 				pointer->saved.y1,
-                                pointer->saved.x2 -
-                                pointer->saved.x1,
-                                pointer->saved.y2 -
-                                pointer->saved.y1,
-				dx, dy);
-	    }
-	    (void) miDCMoveCursor(pScreen, pCursor,
-				  pointer->saved.x1,
- 				  pointer->saved.y1,
-                                  pointer->saved.x2 -
-                                  pointer->saved.x1,
-                                  pointer->saved.y2 -
-                                  pointer->saved.y1,
-				  sx - pointer->saved.x1,
-				  sy - pointer->saved.y1,
-				  pointer->colors[SOURCE_COLOR].pixel,
-				  pointer->colors[MASK_COLOR].pixel);
-	    miSpriteIsUp(pCursorInfo);
-	    DamageDrawInternal (pScreen, FALSE);
-	}
-	else
-#endif
-	{
-	    SPRITE_DEBUG (("SetCursor remove %d\n", pDev->id));
-	    miSpriteRemoveCursor (pDev, pScreen);
-	}
+	/* TODO: reimplement flicker-free MoveCursor */
+	SPRITE_DEBUG (("SetCursor remove %d\n", pDev->id));
+	miSpriteRemoveCursor (pDev, pScreen);
     }
 
     if (!pPointer->isUp && pPointer->pCursor)
diff --git a/mi/misprite.h b/mi/misprite.h
index 78bf52c..632d207 100644
--- a/mi/misprite.h
+++ b/mi/misprite.h
@@ -46,12 +46,5 @@ extern Bool miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
                                 int x, int y, int w, int h);
 extern Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
                                    int x, int y, int w, int h);
-extern Bool miDCMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
-                           CursorPtr pCursor, int x, int y,
-                           int w, int h, int dx, int dy,
-                           unsigned long source, unsigned long mask);
-extern Bool miDCChangeSave(DeviceIntPtr pDev, ScreenPtr pScreen,
-                           int x, int y, int w, int h,
-                           int dx, int dy);
 extern Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
 extern void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
commit d1bad1b59f24ab4dcf2d1ce1c5d4f42b5fa40bc1
Author: Jamey Sharp <jamey at minilop.net>
Date:   Tue May 25 14:25:07 2010 -0700

    dmx: Fix XSetExtensionErrorHandler calls to agree on constness.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c
index da5b778..2f23d1c 100644
--- a/hw/dmx/input/dmxcommon.c
+++ b/hw/dmx/input/dmxcommon.c
@@ -370,7 +370,7 @@ void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
     Display              *display = priv->display;
     int                  num;
     int                  i, j, k;
-    int                  (*handler)(Display *, char *, char *);
+    XextErrorHandler     handler;
 
     if (!display && !(display = XOpenDisplay(dmxInput->name)))
         return;
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 5943e92..1242be1 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -827,7 +827,7 @@ static void dmxPopulateLocal(DMXInputInfo *dmxInput, dmxArg a)
     }
 }
 
-int dmxInputExtensionErrorHandler(Display *dsp, char *name, char *reason)
+int dmxInputExtensionErrorHandler(Display *dsp, _Xconst char *name, _Xconst char *reason)
 {
     return 0;
 }
@@ -839,7 +839,7 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
     Display              *display;
     int                  num;
     int                  i, j;
-    int                  (*handler)(Display *, char *, char *);
+    XextErrorHandler     handler;
 
     if (!(display = XOpenDisplay(dmxInput->name))) return;
     
diff --git a/hw/dmx/input/dmxinputinit.h b/hw/dmx/input/dmxinputinit.h
index 2e625cf..5a4a410 100644
--- a/hw/dmx/input/dmxinputinit.h
+++ b/hw/dmx/input/dmxinputinit.h
@@ -276,8 +276,8 @@ extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl);
 extern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
                                 pointer ctrl, int unknown);
 
-extern int  dmxInputExtensionErrorHandler(Display *dsp, char *name,
-                                          char *reason);
+extern int  dmxInputExtensionErrorHandler(Display *dsp, _Xconst char *name,
+                                          _Xconst char *reason);
 
 extern int          dmxInputDetach(DMXInputInfo *dmxInput);
 extern void         dmxInputDetachAll(DMXScreenInfo *dmxScreen);
commit aa7c09f7d04d59852b850b2b6993f4cbdc7ec940
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Jun 2 14:31:56 2010 -0700

    Install fbdevhw module in normal module directory instead of linux/
    
    Since we no longer support OS-independent custom elfloader modules,
    we don't need to put the OS-dependent modules into os-specific subdirs
    any more.
    
    We do however still need to install the stubs version of this module
    on non-Linux platforms, since a number of drivers link to functions
    in it, even when built on non-Linux platforms.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am
index 0663525..76a69c1 100644
--- a/hw/xfree86/fbdevhw/Makefile.am
+++ b/hw/xfree86/fbdevhw/Makefile.am
@@ -1,5 +1,4 @@
-linuxmoduledir = $(moduledir)/linux
-linuxmodule_LTLIBRARIES = libfbdevhw.la
+module_LTLIBRARIES = libfbdevhw.la
 
 libfbdevhw_la_LDFLAGS = -avoid-version
 


More information about the xorg-commit mailing list