aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXwindow.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c56
1 files changed, 33 insertions, 23 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index 5df252d34..d108d3ef3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
@@ -138,9 +138,7 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
void nxagentClearSplash(WindowPtr pW)
{
- ScreenPtr pScreen;
-
- pScreen = pW->drawable.pScreen;
+ ScreenPtr pScreen = pW->drawable.pScreen;
if (pW->backgroundState == BackgroundPixmap)
{
@@ -189,9 +187,6 @@ MakeRootTile(WindowPtr pWin)
for (j = len; j > 0; j--)
*to++ = *from;
- if (blackRoot)
- bzero(back, sizeof(back));
-
(*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1,
0, 0, len, 4, 0, XYBitmap, (char *)back);
@@ -203,7 +198,8 @@ MakeRootTile(WindowPtr pWin)
void
InitRootWindow(WindowPtr pWin)
{
- ScreenPtr pScreen;
+ 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",
@@ -220,8 +216,6 @@ InitRootWindow(WindowPtr pWin)
nxagentRootlessWindow = pWin;
}
- pScreen = pWin->drawable.pScreen;
-
/*
* A root window is created for each screen by main
* and the pointer is saved in screenInfo.screens as
@@ -254,20 +248,34 @@ InitRootWindow(WindowPtr pWin)
pWin->cursorIsNone = FALSE;
pWin->optional->cursor = rootCursor;
rootCursor->refcnt++;
+
+#ifdef NXAGENT_SPLASH
+ if (blackRoot)
+ pWin->background.pixel = pScreen->blackPixel;
+ else
+ pWin->background.pixel = pScreen->whitePixel;
+ backFlag |= CWBackPixel;
+
+ MakeRootTile(pWin);
+#else
+ if (!blackRoot && !whiteRoot) {
+ MakeRootTile(pWin);
+ backFlag |= CWBackPixmap;
+ }
+ else {
+ if (blackRoot)
+ pWin->background.pixel = pScreen->blackPixel;
+ else
+ pWin->background.pixel = pScreen->whitePixel;
+ backFlag |= CWBackPixel;
+ }
+#endif
+
pWin->backingStore = defaultBackingStore;
pWin->forcedBS = (defaultBackingStore != NotUseful);
- #ifdef NXAGENT_SPLASH
/* We SHOULD check for an error value here XXX */
- pWin -> background.pixel = pScreen -> blackPixel;
- (*pScreen->ChangeWindowAttributes)(pWin,
- CWBackPixel|CWBorderPixel|CWCursor|CWBackingStore);
- #else
- (*pScreen->ChangeWindowAttributes)(pWin,
- CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore);
- #endif
-
- MakeRootTile(pWin);
+ (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
/*
* Map both the root and the default agent window.
@@ -310,6 +318,7 @@ DeleteWindow(void * value, XID wid)
{
register WindowPtr pParent;
register WindowPtr pWin = (WindowPtr)value;
+ xEvent event;
UnmapWindow(pWin, FALSE);
@@ -318,7 +327,7 @@ DeleteWindow(void * value, XID wid)
pParent = pWin->parent;
if (wid && pParent && SubStrSend(pWin, pParent))
{
- xEvent event = {0};
+ memset(&event, 0, sizeof(xEvent));
event.u.u.type = DestroyNotify;
event.u.destroyNotify.window = pWin->drawable.id;
DeliverEvents(pWin, &event, 1, NullWindow);
@@ -874,7 +883,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
}
pWin->mapped = TRUE;
- if (SubStrSend(pWin, pParent))
+ if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin))
{
memset(&event, 0, sizeof(xEvent));
event.u.u.type = MapNotify;
@@ -945,6 +954,7 @@ int
UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
{
register WindowPtr pParent;
+ xEvent event;
Bool wasRealized = (Bool)pWin->realized;
Bool wasViewable = (Bool)pWin->viewable;
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -960,9 +970,9 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
if ((!pWin->mapped) || (!(pParent = pWin->parent)))
return(Success);
- if (SubStrSend(pWin, pParent))
+ if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin))
{
- xEvent event = {0};
+ memset(&event, 0, sizeof(xEvent));
event.u.u.type = UnmapNotify;
event.u.unmapNotify.window = pWin->drawable.id;
event.u.unmapNotify.fromConfigure = fromConfigure;