aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-02-03 00:19:29 +0100
committerMihai Moldovan <ionic@ionic.de>2018-02-26 05:10:15 +0100
commit6dcfcbabe6b87467a6f811d0dc03efba7bfce8e4 (patch)
tree19559f26bed90d12689ee47145b27fcd7619820a
parent1b54f6462bd8c0ec5eda2007794bbd76f73f6df2 (diff)
downloadnx-libs-6dcfcbabe6b87467a6f811d0dc03efba7bfce8e4.tar.gz
nx-libs-6dcfcbabe6b87467a6f811d0dc03efba7bfce8e4.tar.bz2
nx-libs-6dcfcbabe6b87467a6f811d0dc03efba7bfce8e4.zip
Transfer previous dix changes into hw/nxagent
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index 327b6ff68..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);
@@ -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;
@@ -962,7 +972,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
return(Success);
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;