Skip to content

Commit

Permalink
NXwindow.c: call InitRootWindow from dix
Browse files Browse the repository at this point in the history
  • Loading branch information
uli42 committed Sep 1, 2019
1 parent d830e55 commit 047ab33
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 49 deletions.
6 changes: 4 additions & 2 deletions nx-X11/programs/Xserver/dix/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,12 @@ CreateRootWindow(ScreenPtr pScreen)
return TRUE;
}

#ifndef NXAGENT_SERVER
void
#ifdef NXAGENT_SERVER
xorg_InitRootWindow(WindowPtr pWin)
#else
InitRootWindow(WindowPtr pWin)
#endif
{
ScreenPtr pScreen = pWin->drawable.pScreen;
int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
Expand Down Expand Up @@ -531,7 +534,6 @@ InitRootWindow(WindowPtr pWin)

MapWindow(pWin, serverClient);
}
#endif /* NXAGENT_SERVER */

/* Set the region to the intersection of the rectangle and the
* window's winSize. The window is typically the parent of the
Expand Down
57 changes: 10 additions & 47 deletions nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,6 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
void
InitRootWindow(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
int backFlag = CWBorderPixel | CWCursor | CWBackingStore;

#ifdef TEST
fprintf(stderr, "InitRootWindow: Called for window at [%p][%ld] with parent [%p].\n",
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
#endif

if (nxagentOption(Rootless))
{
#ifdef TEST
fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n",
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
#endif

nxagentRootlessWindow = pWin;
}

/*
* A root window is created for each screen by main
* and the pointer is saved in screenInfo.screens as
Expand All @@ -165,36 +147,17 @@ InitRootWindow(WindowPtr pWin)
* if you prefer) fits in the big picture.
*/

#ifdef TEST
fprintf(stderr, "InitRootWindow: Going to create window as root at [%p][%ld] with parent [%p].\n",
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
#endif

if (!(*pScreen->CreateWindow)(pWin))
return; /* XXX */

#ifdef TEST
fprintf(stderr, "InitRootWindow: Created window as root at [%p][%ld] with parent [%p].\n",
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
#endif

(*pScreen->PositionWindow)(pWin, 0, 0);

pWin->cursorIsNone = FALSE;
pWin->optional->cursor = rootCursor;
rootCursor->refcnt++;

if (blackRoot)
pWin->background.pixel = pScreen->blackPixel;
else
pWin->background.pixel = pScreen->whitePixel;
backFlag |= CWBackPixel;
if (nxagentOption(Rootless))
{
#ifdef TEST
fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n",
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
#endif

pWin->backingStore = defaultBackingStore;
pWin->forcedBS = (defaultBackingStore != NotUseful);
nxagentRootlessWindow = pWin;
}

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

/*
* Map both the root and the default agent window.
Expand All @@ -219,7 +182,7 @@ InitRootWindow(WindowPtr pWin)
extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
nPort = atoi(display) + 7000;
sprintf(artsd_port,"%d", nPort);
nxagentPropagateArtsdProperties(pScreen, artsd_port);
nxagentPropagateArtsdProperties(pWin->drawable.pScreen, artsd_port);
}
#endif

Expand Down
4 changes: 4 additions & 0 deletions nx-X11/programs/Xserver/hw/nxagent/Window.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,10 @@ void nxagentMapDefaultWindows(void)
WindowPtr pWin = screenInfo.screens[i]->root;
ScreenPtr pScreen = pWin -> drawable.pScreen;

/*
* InitRootWindow does that already, but as MapWindow() is
* idempotent we keep it here, too
*/
MapWindow(pWin, serverClient);

if (nxagentOption(Rootless) == 0)
Expand Down

0 comments on commit 047ab33

Please sign in to comment.