Commit cf0571bb authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXwindow.c: call InitRootWindow from dix

parent 5327a85b
...@@ -497,9 +497,12 @@ CreateRootWindow(ScreenPtr pScreen) ...@@ -497,9 +497,12 @@ CreateRootWindow(ScreenPtr pScreen)
return TRUE; return TRUE;
} }
#ifndef NXAGENT_SERVER
void void
#ifdef NXAGENT_SERVER
xorg_InitRootWindow(WindowPtr pWin)
#else
InitRootWindow(WindowPtr pWin) InitRootWindow(WindowPtr pWin)
#endif
{ {
ScreenPtr pScreen = pWin->drawable.pScreen; ScreenPtr pScreen = pWin->drawable.pScreen;
int backFlag = CWBorderPixel | CWCursor | CWBackingStore; int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
...@@ -531,7 +534,6 @@ InitRootWindow(WindowPtr pWin) ...@@ -531,7 +534,6 @@ InitRootWindow(WindowPtr pWin)
MapWindow(pWin, serverClient); MapWindow(pWin, serverClient);
} }
#endif /* NXAGENT_SERVER */
/* Set the region to the intersection of the rectangle and the /* Set the region to the intersection of the rectangle and the
* window's winSize. The window is typically the parent of the * window's winSize. The window is typically the parent of the
......
...@@ -132,24 +132,6 @@ extern void nxagentSetVersionProperty(WindowPtr pWin); ...@@ -132,24 +132,6 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
void void
InitRootWindow(WindowPtr pWin) 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 * A root window is created for each screen by main
* and the pointer is saved in screenInfo.screens as * and the pointer is saved in screenInfo.screens as
...@@ -164,36 +146,17 @@ InitRootWindow(WindowPtr pWin) ...@@ -164,36 +146,17 @@ InitRootWindow(WindowPtr pWin)
* if you prefer) fits in the big picture. * if you prefer) fits in the big picture.
*/ */
#ifdef TEST if (nxagentOption(Rootless))
fprintf(stderr, "InitRootWindow: Going to create window as root at [%p][%ld] with parent [%p].\n", {
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); #ifdef TEST
#endif fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n",
(void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent);
if (!(*pScreen->CreateWindow)(pWin)) #endif
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;
pWin->backingStore = defaultBackingStore; nxagentRootlessWindow = pWin;
pWin->forcedBS = (defaultBackingStore != NotUseful); }
/* We SHOULD check for an error value here XXX */ xorg_InitRootWindow(pWin);
(*pScreen->ChangeWindowAttributes)(pWin, backFlag);
/* /*
* Map both the root and the default agent window. * Map both the root and the default agent window.
...@@ -214,7 +177,7 @@ InitRootWindow(WindowPtr pWin) ...@@ -214,7 +177,7 @@ InitRootWindow(WindowPtr pWin)
char artsd_port[10]; char artsd_port[10];
short int nPort = atoi(display) + 7000; short int nPort = atoi(display) + 7000;
sprintf(artsd_port,"%d", nPort); sprintf(artsd_port,"%d", nPort);
nxagentPropagateArtsdProperties(pScreen, artsd_port); nxagentPropagateArtsdProperties(pWin->drawable.pScreen, artsd_port);
} }
#endif #endif
......
...@@ -2538,6 +2538,10 @@ void nxagentMapDefaultWindows(void) ...@@ -2538,6 +2538,10 @@ void nxagentMapDefaultWindows(void)
WindowPtr pWin = screenInfo.screens[i]->root; WindowPtr pWin = screenInfo.screens[i]->root;
ScreenPtr pScreen = pWin -> drawable.pScreen; ScreenPtr pScreen = pWin -> drawable.pScreen;
/*
* InitRootWindow does that already, but as MapWindow() is
* idempotent we keep it here, too
*/
MapWindow(pWin, serverClient); MapWindow(pWin, serverClient);
if (nxagentOption(Rootless) == 0) if (nxagentOption(Rootless) == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment