aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Screen.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-20 12:18:53 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-21 04:09:16 +0200
commitc61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad (patch)
tree99b43f999db460959346ca3d29d261052deb6b3d /nx-X11/programs/Xserver/hw/nxagent/Screen.c
parent590862d39d6e7cea6425416a5ef6fa2e747bcc0c (diff)
downloadnx-libs-c61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad.tar.gz
nx-libs-c61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad.tar.bz2
nx-libs-c61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad.zip
Move each screen's root-window pointer into ScreenRec.
Backported from X.org: commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a Author: Jamey Sharp <jamey@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@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Screen.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 50d278ed7..a4b39a4fe 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -2116,7 +2116,7 @@ Bool nxagentCloseScreen(int index, ScreenPtr pScreen)
static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
{
- WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = FALSE;
@@ -2409,21 +2409,21 @@ FIXME: We should try to restore the previously
box.x2 = width;
box.y2 = height;
- WindowTable[pScreen -> myNum] -> drawable.width = width;
- WindowTable[pScreen -> myNum] -> drawable.height = height;
- WindowTable[pScreen -> myNum] -> drawable.x = 0;
- WindowTable[pScreen -> myNum] -> drawable.y = 0;
+ pScreen->root -> drawable.width = width;
+ pScreen->root -> drawable.height = height;
+ pScreen->root -> drawable.x = 0;
+ pScreen->root -> drawable.y = 0;
- RegionInit(&WindowTable[pScreen -> myNum] -> borderSize, &box, 1);
- RegionInit(&WindowTable[pScreen -> myNum] -> winSize, &box, 1);
- RegionInit(&WindowTable[pScreen -> myNum] -> clipList, &box, 1);
- RegionInit(&WindowTable[pScreen -> myNum] -> borderClip, &box, 1);
+ RegionInit(&pScreen->root -> borderSize, &box, 1);
+ RegionInit(&pScreen->root -> winSize, &box, 1);
+ RegionInit(&pScreen->root -> clipList, &box, 1);
+ RegionInit(&pScreen->root -> borderClip, &box, 1);
- (*pScreen -> PositionWindow)(WindowTable[pScreen -> myNum], 0, 0);
+ (*pScreen -> PositionWindow)(pScreen->root, 0, 0);
nxagentSetRootClip(pScreen, 1);
- XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[0]),
+ XMoveWindow(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root),
nxagentOption(RootX), nxagentOption(RootY));
nxagentMoveViewport(pScreen, 0, 0);
@@ -3522,7 +3522,7 @@ FIXME: The port information is not used at the moment and produces a
{
mcop_local_atom = MakeAtom(mcop_atom, strlen(mcop_atom), 1);
- ChangeWindowProperty(WindowTable[pScreen->myNum],
+ ChangeWindowProperty(pScreen->root,
mcop_local_atom,
XA_STRING,
iReturnFormat, PropModeReplace,
@@ -3667,9 +3667,9 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in
int r;
#ifdef TEST
- fprintf(stderr, "nxagentChangeScreenConfig: WindowTable[%d] is %p\n", screen, WindowTable[screen]);
+ fprintf(stderr, "nxagentChangeScreenConfig: screenInfo.screens[%d]->root is %p\n", screen, screenInfo.screens[screen]);
#endif
- if (WindowTable[screen] == NULL)
+ if (screenInfo.screens[screen]->root == NULL)
{
return 0;
}
@@ -3692,7 +3692,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in
return 0;
}
- pScreen = WindowTable[screen] -> drawable.pScreen;
+ pScreen = screenInfo.screens[screen] -> root -> drawable.pScreen;
#ifdef TEST
fprintf(stderr, "nxagentChangeScreenConfig: Changing config to %dx%d.\n", width, height);
@@ -4124,7 +4124,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
values.subwindow_mode = IncludeInferiors;
- gc = XCreateGC(nxagentDisplay, nxagentWindow(WindowTable[0]), GCSubwindowMode, &values);
+ gc = XCreateGC(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root), GCSubwindowMode, &values);
/*
* Initialize to the corrupted region.
@@ -4234,7 +4234,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
*/
RegionIntersect(prgnRestore, prgnRestore,
- &WindowTable[pWin -> drawable.pScreen -> myNum] -> winSize);
+ &pWin -> drawable.pScreen -> root -> winSize);
pBackingStore = (miBSWindowPtr) pWin -> backStorage;
@@ -4245,7 +4245,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
values.subwindow_mode = ClipByChildren;
- gc = XCreateGC(nxagentDisplay, nxagentWindow(WindowTable[0]), GCSubwindowMode, &values);
+ gc = XCreateGC(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root), GCSubwindowMode, &values);
/*
* Translate the reference point to the origin of the window.
@@ -4406,7 +4406,7 @@ void nxagentShadowAdaptToRatio(void)
nxagentShadowSetRatio(nxagentOption(Width) * 1.0 / nxagentShadowWidth,
nxagentOption(Height) * 1.0 / nxagentShadowHeight);
- nxagentShadowCreateMainWindow(pScreen, WindowTable[0], nxagentShadowWidth, nxagentShadowHeight);
+ nxagentShadowCreateMainWindow(pScreen, screenInfo.screens[0]->root, nxagentShadowWidth, nxagentShadowHeight);
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
@@ -4456,7 +4456,7 @@ void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height)
XlibGC gc;
XGCValues value;
XImage *image;
- WindowPtr pWin = WindowTable[0];
+ WindowPtr pWin = screenInfo.screens[0]->root;
unsigned int format;
int depth, pixmapWidth, pixmapHeight, length;
char *data;
@@ -4668,7 +4668,7 @@ FIXME
value.fill_style = FillSolid;
value.function = GXcopy;
- gc = XCreateGC(shadow, nxagentWindow(WindowTable[0]), GCBackground |
+ gc = XCreateGC(shadow, nxagentWindow(screenInfo.screens[0]->root), GCBackground |
GCForeground | GCFillStyle | GCPlaneMask | GCFunction, &value);
NXCleanImage(image);