summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-08-18 17:04:48 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-08-18 17:04:48 +0300
commitcb0a565d2b2cf8823abbd77b4426cc2237731dc1 (patch)
treec71f2288f18afb15ed54dfe5e748bf75655c8b6f /dix
parent7da51447eaab34292e14077fb5a48e6b2e587781 (diff)
dix: add whiteroot flag
Add a -wr option to use a white root window, and use a BackPixel rather than BackPixmap for both white and black root windows.
Diffstat (limited to 'dix')
-rw-r--r--dix/globals.c1
-rw-r--r--dix/window.c21
2 files changed, 16 insertions, 6 deletions
diff --git a/dix/globals.c b/dix/globals.c
index 5b854aabc..fc77ca793 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -143,6 +143,7 @@ FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
Bool loadableFonts = FALSE;
CursorPtr rootCursor;
Bool blackRoot=FALSE;
+Bool whiteRoot=FALSE;
ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
_X_EXPORT TimeStamp currentTime;
diff --git a/dix/window.c b/dix/window.c
index ebc6923fa..c16f51418 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -343,9 +343,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);
@@ -506,6 +503,7 @@ void
InitRootWindow(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
+ int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
if (!(*pScreen->CreateWindow)(pWin))
return; /* XXX */
@@ -514,12 +512,23 @@ InitRootWindow(WindowPtr pWin)
pWin->cursorIsNone = FALSE;
pWin->optional->cursor = rootCursor;
rootCursor->refcnt++;
- MakeRootTile(pWin);
+
+ if (!blackRoot && !whiteRoot) {
+ MakeRootTile(pWin);
+ backFlag |= CWBackPixmap;
+ }
+ else {
+ if (blackRoot)
+ pWin->background.pixel = blackPixel;
+ else
+ pWin->background.pixel = whitePixel;
+ backFlag |= CWBackPixel;
+ }
+
pWin->backingStore = defaultBackingStore;
pWin->forcedBS = (defaultBackingStore != NotUseful);
/* We SHOULD check for an error value here XXX */
- (*pScreen->ChangeWindowAttributes)(pWin,
- CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore);
+ (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
MapWindow(pWin, serverClient);
}