1 From eff3bb9c6f0b71a57705885a3fe6e6469d252d2b Mon Sep 17 00:00:00 2001
2 From: Fedora X Ninjas <x@fedoraproject.org>
3 Date: Wed, 20 Jan 2010 14:46:12 +1300
4 Subject: [PATCH] Add nr for background=none root
8 dix/window.c | 12 +++++++-----
9 hw/xfree86/common/xf86Init.c | 11 +++++++++++
10 hw/xfree86/common/xf86str.h | 5 ++++-
11 include/opaque.h | 1 +
13 6 files changed, 27 insertions(+), 6 deletions(-)
15 diff --git a/dix/globals.c b/dix/globals.c
16 index c24a94f..907a5e8 100644
19 @@ -124,6 +124,7 @@ FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
21 Bool party_like_its_1989 = FALSE;
22 Bool whiteRoot = FALSE;
23 +Bool bgNoneRoot = FALSE;
25 int cursorScreenDevPriv[MAXSCREENS];
27 diff --git a/dix/window.c b/dix/window.c
28 index caff1cb..be1d1c4 100644
31 @@ -466,22 +466,24 @@ InitRootWindow(WindowPtr pWin)
32 pWin->optional->cursor = rootCursor;
35 + pWin->backingStore = defaultBackingStore;
36 + pWin->forcedBS = (defaultBackingStore != NotUseful);
38 if (party_like_its_1989) {
40 backFlag |= CWBackPixmap;
41 + pScreen->ChangeWindowAttributes(pWin, backFlag);
42 + } else if (bgNoneRoot) {
43 + /* nothing, handled in xf86CreateRootWindow */
46 pWin->background.pixel = pScreen->whitePixel;
48 pWin->background.pixel = pScreen->blackPixel;
49 backFlag |= CWBackPixel;
52 - pWin->backingStore = defaultBackingStore;
53 - pWin->forcedBS = (defaultBackingStore != NotUseful);
54 - /* We SHOULD check for an error value here XXX */
55 - (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
56 + pScreen->ChangeWindowAttributes(pWin, backFlag);
59 MapWindow(pWin, serverClient);
61 diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
62 index 6707448..776b898 100644
63 --- a/hw/xfree86/common/xf86Init.c
64 +++ b/hw/xfree86/common/xf86Init.c
67 #include "picturestr.h"
71 #include "xf86VGAarbiter.h"
73 @@ -254,6 +255,7 @@ xf86CreateRootWindow(WindowPtr pWin)
76 ScreenPtr pScreen = pWin->drawable.pScreen;
77 + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
79 CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
80 dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
81 @@ -305,6 +307,15 @@ xf86CreateRootWindow(WindowPtr pWin)
85 + if (bgNoneRoot && pScrn->canDoBGNoneRoot) {
86 + pWin->backgroundState = XaceBackgroundNoneState(pWin);
87 + pWin->background.pixel = pScreen->whitePixel;
88 + pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore);
90 + pWin->background.pixel = pScreen->blackPixel;
91 + pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore);
94 DebugF("xf86CreateRootWindow() returns %d\n", ret);
97 diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
98 index de1f1b6..5c3aa00 100644
99 --- a/hw/xfree86/common/xf86str.h
100 +++ b/hw/xfree86/common/xf86str.h
101 @@ -503,7 +503,7 @@ typedef struct _confdrirec {
102 } confDRIRec, *confDRIPtr;
104 /* These values should be adjusted when new fields are added to ScrnInfoRec */
105 -#define NUM_RESERVED_INTS 16
106 +#define NUM_RESERVED_INTS 15
107 #define NUM_RESERVED_POINTERS 14
108 #define NUM_RESERVED_FUNCS 11
110 @@ -775,6 +775,9 @@ typedef struct _ScrnInfoRec {
111 ClockRangePtr clockRanges;
115 + int canDoBGNoneRoot;
118 * These can be used when the minor ABI version is incremented.
119 * The NUM_* parameters must be reduced appropriately to keep the
120 diff --git a/include/opaque.h b/include/opaque.h
121 index b3c7c70..fcc8c95 100644
122 --- a/include/opaque.h
123 +++ b/include/opaque.h
124 @@ -71,6 +71,7 @@ extern _X_EXPORT Bool defeatAccessControl;
125 extern _X_EXPORT long maxBigRequestSize;
126 extern _X_EXPORT Bool party_like_its_1989;
127 extern _X_EXPORT Bool whiteRoot;
128 +extern _X_EXPORT Bool bgNoneRoot;
130 extern _X_EXPORT Bool CoreDump;
132 diff --git a/os/utils.c b/os/utils.c
133 index d7c8388..40583d0 100644
136 @@ -513,6 +513,7 @@ void UseMsg(void)
138 ErrorF("-nolisten string don't listen on protocol\n");
139 ErrorF("-noreset don't reset after last client exists\n");
140 + ErrorF("-nr create root window with no background\n");
141 ErrorF("-reset reset after last client exists\n");
142 ErrorF("-p # screen-saver pattern duration (minutes)\n");
143 ErrorF("-pn accept failure to listen on all ports\n");
144 @@ -856,6 +857,8 @@ ProcessCommandLine(int argc, char *argv[])
145 defaultBackingStore = WhenMapped;
146 else if ( strcmp( argv[i], "-wr") == 0)
148 + else if ( strcmp( argv[i], "-nr") == 0)
150 else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
152 long reqSizeArg = atol(argv[i]);