Skip to content

Commit 047ab33

Browse files
committed
NXwindow.c: call InitRootWindow from dix
1 parent d830e55 commit 047ab33

File tree

3 files changed

+18
-49
lines changed

3 files changed

+18
-49
lines changed

nx-X11/programs/Xserver/dix/window.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,12 @@ CreateRootWindow(ScreenPtr pScreen)
497497
return TRUE;
498498
}
499499

500-
#ifndef NXAGENT_SERVER
501500
void
501+
#ifdef NXAGENT_SERVER
502+
xorg_InitRootWindow(WindowPtr pWin)
503+
#else
502504
InitRootWindow(WindowPtr pWin)
505+
#endif
503506
{
504507
ScreenPtr pScreen = pWin->drawable.pScreen;
505508
int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
@@ -531,7 +534,6 @@ InitRootWindow(WindowPtr pWin)
531534

532535
MapWindow(pWin, serverClient);
533536
}
534-
#endif /* NXAGENT_SERVER */
535537

536538
/* Set the region to the intersection of the rectangle and the
537539
* window's winSize. The window is typically the parent of the

nx-X11/programs/Xserver/hw/nxagent/NXwindow.c

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,6 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
133133
void
134134
InitRootWindow(WindowPtr pWin)
135135
{
136-
ScreenPtr pScreen = pWin->drawable.pScreen;
137-
int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
138-
139-
#ifdef TEST
140-
fprintf(stderr, "InitRootWindow: Called for window at [%p][%ld] with parent [%p].\n",
141-
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
142-
#endif
143-
144-
if (nxagentOption(Rootless))
145-
{
146-
#ifdef TEST
147-
fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n",
148-
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
149-
#endif
150-
151-
nxagentRootlessWindow = pWin;
152-
}
153-
154136
/*
155137
* A root window is created for each screen by main
156138
* and the pointer is saved in screenInfo.screens as
@@ -165,36 +147,17 @@ InitRootWindow(WindowPtr pWin)
165147
* if you prefer) fits in the big picture.
166148
*/
167149

168-
#ifdef TEST
169-
fprintf(stderr, "InitRootWindow: Going to create window as root at [%p][%ld] with parent [%p].\n",
170-
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
171-
#endif
172-
173-
if (!(*pScreen->CreateWindow)(pWin))
174-
return; /* XXX */
175-
176-
#ifdef TEST
177-
fprintf(stderr, "InitRootWindow: Created window as root at [%p][%ld] with parent [%p].\n",
178-
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
179-
#endif
180-
181-
(*pScreen->PositionWindow)(pWin, 0, 0);
182-
183-
pWin->cursorIsNone = FALSE;
184-
pWin->optional->cursor = rootCursor;
185-
rootCursor->refcnt++;
186-
187-
if (blackRoot)
188-
pWin->background.pixel = pScreen->blackPixel;
189-
else
190-
pWin->background.pixel = pScreen->whitePixel;
191-
backFlag |= CWBackPixel;
150+
if (nxagentOption(Rootless))
151+
{
152+
#ifdef TEST
153+
fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n",
154+
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
155+
#endif
192156

193-
pWin->backingStore = defaultBackingStore;
194-
pWin->forcedBS = (defaultBackingStore != NotUseful);
157+
nxagentRootlessWindow = pWin;
158+
}
195159

196-
/* We SHOULD check for an error value here XXX */
197-
(*pScreen->ChangeWindowAttributes)(pWin, backFlag);
160+
xorg_InitRootWindow(pWin);
198161

199162
/*
200163
* Map both the root and the default agent window.
@@ -219,7 +182,7 @@ InitRootWindow(WindowPtr pWin)
219182
extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
220183
nPort = atoi(display) + 7000;
221184
sprintf(artsd_port,"%d", nPort);
222-
nxagentPropagateArtsdProperties(pScreen, artsd_port);
185+
nxagentPropagateArtsdProperties(pWin->drawable.pScreen, artsd_port);
223186
}
224187
#endif
225188

nx-X11/programs/Xserver/hw/nxagent/Window.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,6 +2539,10 @@ void nxagentMapDefaultWindows(void)
25392539
WindowPtr pWin = screenInfo.screens[i]->root;
25402540
ScreenPtr pScreen = pWin -> drawable.pScreen;
25412541

2542+
/*
2543+
* InitRootWindow does that already, but as MapWindow() is
2544+
* idempotent we keep it here, too
2545+
*/
25422546
MapWindow(pWin, serverClient);
25432547

25442548
if (nxagentOption(Rootless) == 0)

0 commit comments

Comments
 (0)