summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-06-03 15:09:32 -0700
committerKeith Packard <keithp@keithp.com>2010-06-03 15:09:32 -0700
commit0f12e86e600522768f5f64eafc1230526e700ab7 (patch)
tree616002b2996ba0c39be05c3d7ea5e06a9c001a41 /hw
parentaa7c09f7d04d59852b850b2b6993f4cbdc7ec940 (diff)
parentf114f54986aca1add4c8808a05d9692e289547e7 (diff)
Merge remote branch 'jamey/for-keith'
Diffstat (limited to 'hw')
-rw-r--r--hw/dmx/dmxcursor.c62
-rw-r--r--hw/dmx/dmxextension.c26
-rw-r--r--hw/dmx/doc/dmx.xml15
-rw-r--r--hw/dmx/input/dmxcommon.c9
-rw-r--r--hw/dmx/input/dmxconsole.c25
-rw-r--r--hw/dmx/input/dmxinputinit.c6
-rw-r--r--hw/dmx/input/dmxinputinit.h4
-rw-r--r--hw/kdrive/src/kdrive.c7
-rw-r--r--hw/xfree86/common/xf86Cursor.c94
-rw-r--r--hw/xfree86/common/xf86Helper.c2
-rw-r--r--hw/xfree86/common/xf86RandR.c2
-rw-r--r--hw/xfree86/common/xf86xv.c2
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c2
-rw-r--r--hw/xfree86/dri/dri.c2
-rw-r--r--hw/xfree86/dri2/dri2.c2
-rw-r--r--hw/xfree86/modes/xf86RandR12.c6
-rw-r--r--hw/xfree86/modes/xf86Rotate.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c2
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c2
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c2
-rw-r--r--hw/xquartz/applewm.c6
-rw-r--r--hw/xquartz/darwin.c24
-rw-r--r--hw/xquartz/darwinEvents.c4
-rw-r--r--hw/xquartz/pseudoramiX.c4
-rw-r--r--hw/xquartz/quartz.c14
-rw-r--r--hw/xquartz/xpr/xprCursor.c4
-rw-r--r--hw/xquartz/xpr/xprFrame.c2
-rw-r--r--hw/xquartz/xpr/xprScreen.c4
-rw-r--r--hw/xwin/winkeybd.c2
-rw-r--r--hw/xwin/winscrinit.c6
-rwxr-xr-xhw/xwin/winwin32rootlesswindow.c2
-rw-r--r--hw/xwin/winwindow.c2
32 files changed, 171 insertions, 179 deletions
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index bf5640db7..7e0368699 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 c8e8dae65..5945a5eda 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;
@@ -447,18 +447,18 @@ 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);
/* 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/doc/dmx.xml b/hw/dmx/doc/dmx.xml
index 12d7067dc..c6dc0ccd4 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
@@ -1509,13 +1507,10 @@ 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
- 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
- physical screens is taken from the array
- dixScreenOrigins&lsqb;&rsqb;, which
+ <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
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 da5b77893..c665dad90 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;
@@ -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 9542efacd..297166edd 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 = WindowTable[i];
+ 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/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 5943e9248..814fc1a89 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -570,7 +570,7 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
int i;
#ifdef PANORAMIX
- if (!noPanoramiXExtension && pWindow && pWindow->parent != WindowTable[0])
+ if (!noPanoramiXExtension && pWindow && pWindow->parent != screenInfo.screens[0]->root)
return;
#endif
#if DMX_WINDOW_DEBUG
@@ -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 2e625cfd4..5a4a4106c 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);
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 9d1b38376..7993f9bd1 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;
@@ -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 9cde0599d..714743a8c 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/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index d4b935157..1aad2d100 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1062,7 +1062,7 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen)
static void
xf86SetRootClip (ScreenPtr pScreen, Bool enable)
{
- WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = FALSE;
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 455a02cc2..77053b8c2 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -159,7 +159,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
int oldmmHeight = pScreen->mmHeight;
int oldVirtualX = scrp->virtualX;
int oldVirtualY = scrp->virtualY;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
+ WindowPtr pRoot = pScreen->root;
Bool ret = TRUE;
if (pRoot && scrp->vtSema)
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 2b33f2585..efed677af 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1881,7 +1881,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
void
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
{
- DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
+ DrawablePtr root = &pScreen->root->drawable;
ChangeGCVal pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes);
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 754fe372c..448762879 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -347,7 +347,7 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
ev.type = XF86VidModeNotify + XF86VidModeEventBase;
ev.state = state;
ev.timestamp = currentTime.milliseconds;
- ev.root = WindowTable[pScreen->myNum]->drawable.id;
+ ev.root = pScreen->root->drawable.id;
ev.kind = kind;
ev.forced = forced;
WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 77f7fe295..f7cea5ede 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1187,7 +1187,7 @@ DRIDriverClipNotify(ScreenPtr pScreen)
if (pDRIPriv->nrWindows > 0) {
pDRIPriv->nrWalked = 0;
- TraverseTree(WindowTable[pScreen->myNum], DRIDCNTreeTraversal,
+ TraverseTree(pScreen->root, DRIDCNTreeTraversal,
(pointer)pDRIWindows);
}
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 556285383..9ec4caa54 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -607,7 +607,7 @@ DRI2CanFlip(DrawablePtr pDraw)
if (pDraw->type == DRAWABLE_PIXMAP)
return TRUE;
- pRoot = WindowTable[pScreen->myNum];
+ pRoot = pScreen->root;
pRootPixmap = pScreen->GetWindowPixmap(pRoot);
pWin = (WindowPtr) pDraw;
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 9dfce3fed..8d598d6e7 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -517,7 +517,7 @@ xf86RandR12SetMode (ScreenPtr pScreen,
int oldHeight = pScreen->height;
int oldmmWidth = pScreen->mmWidth;
int oldmmHeight = pScreen->mmHeight;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
+ WindowPtr pRoot = pScreen->root;
DisplayModePtr currentMode = NULL;
Bool ret = TRUE;
PixmapPtr pspix = NULL;
@@ -685,7 +685,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- WindowPtr pRoot = WindowTable[pScreen->myNum];
+ WindowPtr pRoot = pScreen->root;
PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
Bool ret = FALSE;
int c;
@@ -739,7 +739,7 @@ finish:
if (pRoot && pScrn->vtSema)
(*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
#if RANDR_12_INTERFACE
- if (xf86RandR12Key && WindowTable[pScreen->myNum] && ret)
+ if (xf86RandR12Key && pScreen->root && ret)
RRScreenSizeNotify (pScreen);
#endif
return ret;
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 2714fee51..e3683a8ed 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -76,9 +76,9 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
{
ScrnInfoPtr scrn = crtc->scrn;
ScreenPtr screen = scrn->pScreen;
- WindowPtr root = WindowTable[screen->myNum];
+ WindowPtr root = screen->root;
PixmapPtr dst_pixmap = crtc->rotatedPixmap;
- PictFormatPtr format = compWindowFormat (WindowTable[screen->myNum]);
+ PictFormatPtr format = compWindowFormat (screen->root);
int error;
PicturePtr src, dst;
int n = REGION_NUM_RECTS(region);
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
index d37c8ec1e..d58db8ea1 100644
--- a/hw/xfree86/xaa/xaaCpyWin.c
+++ b/hw/xfree86/xaa/xaaCpyWin.c
@@ -47,7 +47,7 @@ XAACopyWindow(
return;
}
- pwinRoot = WindowTable[pScreen->myNum];
+ pwinRoot = pScreen->root;
REGION_NULL(pScreen, &rgnDst);
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
index 2af808396..14de9bd34 100644
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -54,7 +54,7 @@ XAACopyWindow8_32(
return;
}
- pwinRoot = WindowTable[pScreen->myNum];
+ pwinRoot = pScreen->root;
if(doUnderlay)
freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
index 3b848ac84..b186cb5cd 100644
--- a/hw/xfree86/xaa/xaaOverlayDF.c
+++ b/hw/xfree86/xaa/xaaOverlayDF.c
@@ -324,7 +324,7 @@ XAAOverCopyWindow(
RegionRec rgnDst;
BoxPtr pbox;
int i, nbox, dx, dy;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
+ WindowPtr pRoot = pScreen->root;
if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 0845f67f0..1c77ad984 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 580fe4ae0..7453eccdf 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);
}
}
}
@@ -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/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 421efcedf..147b32a09 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/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index 5868ab129..298ec2be9 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/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 36d18eba3..bb37e4abe 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,14 +269,14 @@ 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 = WindowTable[pScreen->myNum];
+ pRoot = pScreen->root;
AppleWMSetScreenOrigin(pRoot);
pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
@@ -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 c1c8b2005..fdb85630d 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/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 53dde7acc..6dc2c87fa 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -576,7 +576,7 @@ xprHideWindows(Bool hide)
for (screen = 0; screen < screenInfo.numScreens; screen++) {
RootlessFrameID prevWid = NULL;
- pRoot = WindowTable[screenInfo.screens[screen]->myNum];
+ pRoot = screenInfo.screens[screen]->root;
for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
RootlessWindowRec *winRec = WINREC(pWin);
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index d574721b3..87e97d4e2 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -397,7 +397,7 @@ xprUpdateScreen(ScreenPtr pScreen)
rootlessGlobalOffsetX = darwinMainScreenX;
rootlessGlobalOffsetY = darwinMainScreenY;
- AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
+ AppleWMSetScreenOrigin(pScreen->root);
RootlessRepositionWindows(pScreen);
RootlessUpdateScreenPixmap(pScreen);
@@ -416,7 +416,7 @@ xprInitInput(int argc, char **argv)
rootlessGlobalOffsetY = darwinMainScreenY;
for (i = 0; i < screenInfo.numScreens; i++)
- AppleWMSetScreenOrigin(WindowTable[i]);
+ AppleWMSetScreenOrigin(screenInfo.screens[i]->root);
}
/*
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index ad9e66a0b..6d91ce0d6 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -262,7 +262,7 @@ winRestoreModeKeyStates (void)
/* Only process events if the rootwindow is mapped. The keyboard events
* will cause segfaults otherwise */
- if (WindowTable && WindowTable[0] && WindowTable[0]->mapped == FALSE)
+ if (screenInfo.screens[0]->root && screenInfo.screens[0]->root->mapped == FALSE)
processEvents = FALSE;
/* Force to process all pending events in the mi event queue */
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 4fa987cd9..7add0e3f4 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/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
index 3a49ead69..214e8954b 100755
--- a/hw/xwin/winwin32rootlesswindow.c
+++ b/hw/xwin/winwin32rootlesswindow.c
@@ -407,7 +407,7 @@ void
winMWExtWMRestackWindows (ScreenPtr pScreen)
{
winScreenPriv(pScreen);
- WindowPtr pRoot = WindowTable[pScreen->myNum];
+ WindowPtr pRoot = pScreen->root;
WindowPtr pWin = NULL;
WindowPtr pWinPrev = NULL;
win32RootlessWindowPtr pRLWin = NULL;
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index d0c360f34..9348d5c1c 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -144,7 +144,7 @@ winCopyWindowNativeGDI (WindowPtr pWin,
#endif
/* Get a pointer to the root window */
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
+ pwinRoot = pWin->drawable.pScreen->root;
/* Create a region for the destination */
prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);