summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-23 10:11:47 -0700
committerJamey Sharp <jamey@minilop.net>2010-06-03 14:03:23 -0700
commita83cff9f4d622b069c96a68b4e87a669bf1f6446 (patch)
treeb29de5e363feb6b7546ce69dfa0685316bf0b234 /hw
parent217ccaa5a341018457f468a774c035c0df47d918 (diff)
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@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
Diffstat (limited to 'hw')
-rw-r--r--hw/dmx/dmxcursor.c62
-rw-r--r--hw/dmx/dmxextension.c10
-rw-r--r--hw/dmx/doc/dmx.xml3
-rw-r--r--hw/dmx/input/dmxcommon.c7
-rw-r--r--hw/dmx/input/dmxconsole.c25
-rw-r--r--hw/kdrive/src/kdrive.c5
-rw-r--r--hw/xfree86/common/xf86Cursor.c94
-rw-r--r--hw/xquartz/applewm.c6
-rw-r--r--hw/xquartz/darwin.c22
-rw-r--r--hw/xquartz/darwinEvents.c4
-rw-r--r--hw/xquartz/quartz.c12
-rw-r--r--hw/xquartz/xpr/xprCursor.c4
-rw-r--r--hw/xwin/winscrinit.c6
13 files changed, 128 insertions, 132 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 678f29054..5945a5eda 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 251e6ac13..d0c83bbcc 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 2f23d1c9b..c665dad90 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 bf34169ab..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 = 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 10df02dbc..7993f9bd1 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 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/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 825afa0de..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);
}
}
}
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/quartz.c b/hw/xquartz/quartz.c
index ac7fedd13..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,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 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/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");