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.
This commit is contained in:
Daniel Stone 2006-08-18 17:04:48 +03:00 • committed by Daniel Stone
commit cb0a565d2b
4 changed files with 20 additions and 6 deletions

View file

@ -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;

View file

@ -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);
}