2008-10-27 21:28:00 +00:00
|
|
|
From a3e15680da24cb8259f6a83dee0c930dab024290 Mon Sep 17 00:00:00 2001
|
2008-08-15 05:23:40 +00:00
|
|
|
From: Kristian <krh@redhat.com>
|
|
|
|
Date: Fri, 15 Aug 2008 15:15:14 +1000
|
|
|
|
Subject: [PATCH] Add nr for background=none root
|
|
|
|
|
|
|
|
---
|
2008-10-27 21:28:00 +00:00
|
|
|
dix/globals.c | 1 +
|
|
|
|
dix/window.c | 22 ++++++++++++----------
|
|
|
|
hw/xfree86/common/xf86Init.c | 11 +++++++++++
|
|
|
|
hw/xfree86/common/xf86str.h | 5 ++++-
|
|
|
|
include/opaque.h | 1 +
|
|
|
|
os/utils.c | 3 +++
|
|
|
|
6 files changed, 32 insertions(+), 11 deletions(-)
|
2008-08-15 05:23:40 +00:00
|
|
|
|
2008-08-15 00:43:05 +00:00
|
|
|
diff --git a/dix/globals.c b/dix/globals.c
|
2008-08-15 05:19:12 +00:00
|
|
|
index 7f95eab..db34786 100644
|
2008-08-15 00:43:05 +00:00
|
|
|
--- a/dix/globals.c
|
|
|
|
+++ b/dix/globals.c
|
2008-08-15 05:19:12 +00:00
|
|
|
@@ -143,6 +143,7 @@ Bool loadableFonts = FALSE;
|
2008-08-15 00:43:05 +00:00
|
|
|
CursorPtr rootCursor;
|
|
|
|
Bool blackRoot=FALSE;
|
|
|
|
Bool whiteRoot=FALSE;
|
|
|
|
+Bool bgNoneRoot=FALSE;
|
2008-08-15 05:19:12 +00:00
|
|
|
#ifdef XPRINT
|
|
|
|
ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
|
|
|
|
#endif
|
2008-08-15 00:43:05 +00:00
|
|
|
diff --git a/dix/window.c b/dix/window.c
|
2008-10-27 21:28:00 +00:00
|
|
|
index 834c26b..6663a1e 100644
|
2008-08-15 00:43:05 +00:00
|
|
|
--- a/dix/window.c
|
|
|
|
+++ b/dix/window.c
|
2008-10-27 21:28:00 +00:00
|
|
|
@@ -471,23 +471,25 @@ InitRootWindow(WindowPtr pWin)
|
|
|
|
pWin->cursorIsNone = FALSE;
|
2008-08-15 00:43:05 +00:00
|
|
|
pWin->optional->cursor = rootCursor;
|
|
|
|
rootCursor->refcnt++;
|
2008-10-27 21:28:00 +00:00
|
|
|
+ pWin->backingStore = defaultBackingStore;
|
|
|
|
+ pWin->forcedBS = (defaultBackingStore != NotUseful);
|
2008-08-15 00:43:05 +00:00
|
|
|
|
|
|
|
- if (!blackRoot && !whiteRoot) {
|
|
|
|
- MakeRootTile(pWin);
|
2008-08-15 05:19:12 +00:00
|
|
|
- backFlag |= CWBackPixmap;
|
|
|
|
+ if (bgNoneRoot) {
|
2008-10-27 21:28:00 +00:00
|
|
|
+ /* nothing, handled in xf86CreateRootWindow */
|
2008-08-15 00:43:05 +00:00
|
|
|
}
|
|
|
|
- else {
|
2008-08-15 05:19:12 +00:00
|
|
|
+ else if (blackRoot || whiteRoot) {
|
2008-08-15 00:43:05 +00:00
|
|
|
if (blackRoot)
|
|
|
|
pWin->background.pixel = pScreen->blackPixel;
|
|
|
|
else
|
|
|
|
pWin->background.pixel = pScreen->whitePixel;
|
|
|
|
backFlag |= CWBackPixel;
|
2008-08-15 05:19:12 +00:00
|
|
|
- }
|
2008-10-27 21:28:00 +00:00
|
|
|
-
|
|
|
|
- pWin->backingStore = defaultBackingStore;
|
|
|
|
- pWin->forcedBS = (defaultBackingStore != NotUseful);
|
|
|
|
- /* We SHOULD check for an error value here XXX */
|
|
|
|
- (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
|
|
|
|
+ pScreen->ChangeWindowAttributes(pWin, backFlag);
|
2008-08-15 00:43:05 +00:00
|
|
|
+ }
|
2008-08-15 05:19:12 +00:00
|
|
|
+ else {
|
2008-08-15 00:43:05 +00:00
|
|
|
+ MakeRootTile(pWin);
|
|
|
|
+ backFlag |= CWBackPixmap;
|
2008-10-27 21:28:00 +00:00
|
|
|
+ pScreen->ChangeWindowAttributes(pWin, backFlag);
|
2008-08-15 05:19:12 +00:00
|
|
|
+ }
|
2008-08-15 00:43:05 +00:00
|
|
|
|
2008-10-27 21:28:00 +00:00
|
|
|
MapWindow(pWin, serverClient);
|
|
|
|
}
|
|
|
|
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
|
|
|
|
index eb4ebfa..2c18da4 100644
|
|
|
|
--- a/hw/xfree86/common/xf86Init.c
|
|
|
|
+++ b/hw/xfree86/common/xf86Init.c
|
|
|
|
@@ -83,6 +83,7 @@
|
|
|
|
#ifdef RENDER
|
|
|
|
#include "picturestr.h"
|
|
|
|
#endif
|
|
|
|
+#include "xace.h"
|
|
|
|
|
|
|
|
#include "globals.h"
|
|
|
|
|
|
|
|
@@ -137,6 +138,7 @@ xf86CreateRootWindow(WindowPtr pWin)
|
|
|
|
int ret = TRUE;
|
|
|
|
int err = Success;
|
|
|
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
|
|
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
|
|
RootWinPropPtr pProp;
|
|
|
|
CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
|
|
|
|
dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
|
|
|
|
@@ -190,6 +192,15 @@ xf86CreateRootWindow(WindowPtr pWin)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (bgNoneRoot && pScrn->canDoBGNoneRoot) {
|
|
|
|
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
|
|
|
|
+ pWin->background.pixel = pScreen->whitePixel;
|
|
|
|
+ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore);
|
|
|
|
+ } else {
|
|
|
|
+ pWin->background.pixel = pScreen->blackPixel;
|
|
|
|
+ pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
#ifdef DEBUG
|
|
|
|
ErrorF("xf86CreateRootWindow() returns %d\n", ret);
|
|
|
|
#endif
|
|
|
|
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
|
|
|
|
index fc94284..56c5507 100644
|
|
|
|
--- a/hw/xfree86/common/xf86str.h
|
|
|
|
+++ b/hw/xfree86/common/xf86str.h
|
|
|
|
@@ -538,7 +538,7 @@ typedef struct _confdrirec {
|
|
|
|
} confDRIRec, *confDRIPtr;
|
|
|
|
|
|
|
|
/* These values should be adjusted when new fields are added to ScrnInfoRec */
|
|
|
|
-#define NUM_RESERVED_INTS 16
|
|
|
|
+#define NUM_RESERVED_INTS 15
|
|
|
|
#define NUM_RESERVED_POINTERS 15
|
|
|
|
#define NUM_RESERVED_FUNCS 11
|
|
|
|
|
|
|
|
@@ -977,6 +977,9 @@ typedef struct _ScrnInfoRec {
|
|
|
|
ClockRangesPtr clockRanges;
|
|
|
|
int adjustFlags;
|
|
|
|
|
|
|
|
+ /* -nr support */
|
|
|
|
+ int canDoBGNoneRoot;
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* These can be used when the minor ABI version is incremented.
|
|
|
|
* The NUM_* parameters must be reduced appropriately to keep the
|
2008-08-15 00:43:05 +00:00
|
|
|
diff --git a/include/opaque.h b/include/opaque.h
|
2008-08-15 05:19:12 +00:00
|
|
|
index 3d19d27..cf5d135 100644
|
2008-08-15 00:43:05 +00:00
|
|
|
--- a/include/opaque.h
|
|
|
|
+++ b/include/opaque.h
|
2008-08-15 05:19:12 +00:00
|
|
|
@@ -74,6 +74,7 @@ extern Bool defeatAccessControl;
|
2008-08-15 00:43:05 +00:00
|
|
|
extern long maxBigRequestSize;
|
|
|
|
extern Bool blackRoot;
|
|
|
|
extern Bool whiteRoot;
|
|
|
|
+extern Bool bgNoneRoot;
|
|
|
|
|
|
|
|
extern Bool CoreDump;
|
|
|
|
|
|
|
|
diff --git a/os/utils.c b/os/utils.c
|
2008-10-27 21:28:00 +00:00
|
|
|
index f58c763..72a03c8 100644
|
2008-08-15 00:43:05 +00:00
|
|
|
--- a/os/utils.c
|
|
|
|
+++ b/os/utils.c
|
2008-08-15 05:19:12 +00:00
|
|
|
@@ -615,6 +615,7 @@ void UseMsg(void)
|
2008-08-15 00:43:05 +00:00
|
|
|
#endif
|
|
|
|
ErrorF("-nolisten string don't listen on protocol\n");
|
|
|
|
ErrorF("-noreset don't reset after last client exists\n");
|
|
|
|
+ ErrorF("-nr create root window with no background\n");
|
|
|
|
ErrorF("-reset reset after last client exists\n");
|
|
|
|
ErrorF("-p # screen-saver pattern duration (minutes)\n");
|
|
|
|
ErrorF("-pn accept failure to listen on all ports\n");
|
2008-08-15 05:19:12 +00:00
|
|
|
@@ -986,6 +987,8 @@ ProcessCommandLine(int argc, char *argv[])
|
2008-08-15 00:43:05 +00:00
|
|
|
defaultBackingStore = WhenMapped;
|
|
|
|
else if ( strcmp( argv[i], "-wr") == 0)
|
|
|
|
whiteRoot = TRUE;
|
|
|
|
+ else if ( strcmp( argv[i], "-nr") == 0)
|
|
|
|
+ bgNoneRoot = TRUE;
|
|
|
|
else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
|
|
|
|
if(++i < argc) {
|
|
|
|
long reqSizeArg = atol(argv[i]);
|
2008-08-15 05:23:40 +00:00
|
|
|
--
|
2008-10-27 21:28:00 +00:00
|
|
|
1.6.0.1
|
2008-08-15 05:23:40 +00:00
|
|
|
|