1 |
From c89255169f6de9dcaec67509cec1c9b5048b2155 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 02/17] Add nr for background=none root |
5 |
|
6 |
--- |
7 |
dix/globals.c | 1 + |
8 |
dix/window.c | 12 +++++++----- |
9 |
hw/xfree86/common/xf86Init.c | 11 +++++++++++ |
10 |
hw/xfree86/common/xf86str.h | 5 ++++- |
11 |
include/opaque.h | 1 + |
12 |
os/utils.c | 3 +++ |
13 |
6 files changed, 27 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/dix/globals.c b/dix/globals.c |
16 |
index b128569..95dde2d 100644 |
17 |
--- a/dix/globals.c |
18 |
+++ b/dix/globals.c |
19 |
@@ -122,6 +122,7 @@ FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in |
20 |
CursorPtr rootCursor; |
21 |
Bool party_like_its_1989 = FALSE; |
22 |
Bool whiteRoot = FALSE; |
23 |
+Bool bgNoneRoot = FALSE; |
24 |
|
25 |
TimeStamp currentTime; |
26 |
TimeStamp lastDeviceEventTime; |
27 |
diff --git a/dix/window.c b/dix/window.c |
28 |
index 4a47dd5..67da401 100644 |
29 |
--- a/dix/window.c |
30 |
+++ b/dix/window.c |
31 |
@@ -459,22 +459,24 @@ InitRootWindow(WindowPtr pWin) |
32 |
pWin->optional->cursor = rootCursor; |
33 |
rootCursor->refcnt++; |
34 |
|
35 |
+ pWin->backingStore = defaultBackingStore; |
36 |
+ pWin->forcedBS = (defaultBackingStore != NotUseful); |
37 |
|
38 |
if (party_like_its_1989) { |
39 |
MakeRootTile(pWin); |
40 |
backFlag |= CWBackPixmap; |
41 |
+ pScreen->ChangeWindowAttributes(pWin, backFlag); |
42 |
+ } else if (bgNoneRoot) { |
43 |
+ /* nothing, handled in xf86CreateRootWindow */ |
44 |
} else { |
45 |
if (whiteRoot) |
46 |
pWin->background.pixel = pScreen->whitePixel; |
47 |
else |
48 |
pWin->background.pixel = pScreen->blackPixel; |
49 |
backFlag |= CWBackPixel; |
50 |
- } |
51 |
|
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); |
57 |
+ } |
58 |
|
59 |
MapWindow(pWin, serverClient); |
60 |
} |
61 |
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c |
62 |
index ca532ee..6843273 100644 |
63 |
--- a/hw/xfree86/common/xf86Init.c |
64 |
+++ b/hw/xfree86/common/xf86Init.c |
65 |
@@ -76,6 +76,7 @@ |
66 |
#include "xf86Xinput.h" |
67 |
#include "xf86InPriv.h" |
68 |
#include "picturestr.h" |
69 |
+#include "xace.h" |
70 |
|
71 |
#include "xf86Bus.h" |
72 |
#include "xf86VGAarbiter.h" |
73 |
@@ -242,6 +243,7 @@ xf86CreateRootWindow(WindowPtr pWin) |
74 |
int ret = TRUE; |
75 |
int err = Success; |
76 |
ScreenPtr pScreen = pWin->drawable.pScreen; |
77 |
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; |
78 |
RootWinPropPtr pProp; |
79 |
CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr) |
80 |
dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); |
81 |
@@ -293,6 +295,15 @@ xf86CreateRootWindow(WindowPtr pWin) |
82 |
} |
83 |
} |
84 |
|
85 |
+ if (bgNoneRoot && pScrn->canDoBGNoneRoot) { |
86 |
+ pWin->backgroundState = XaceBackgroundNoneState(pWin); |
87 |
+ pWin->background.pixel = pScreen->whitePixel; |
88 |
+ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore); |
89 |
+ } else { |
90 |
+ pWin->background.pixel = pScreen->blackPixel; |
91 |
+ pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore); |
92 |
+ } |
93 |
+ |
94 |
DebugF("xf86CreateRootWindow() returns %d\n", ret); |
95 |
return ret; |
96 |
} |
97 |
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h |
98 |
index c9b261d..f96fc5d 100644 |
99 |
--- a/hw/xfree86/common/xf86str.h |
100 |
+++ b/hw/xfree86/common/xf86str.h |
101 |
@@ -502,7 +502,7 @@ typedef struct _confdrirec { |
102 |
} confDRIRec, *confDRIPtr; |
103 |
|
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 |
109 |
|
110 |
@@ -774,6 +774,9 @@ typedef struct _ScrnInfoRec { |
111 |
ClockRangePtr clockRanges; |
112 |
int adjustFlags; |
113 |
|
114 |
+ /* -nr support */ |
115 |
+ int canDoBGNoneRoot; |
116 |
+ |
117 |
/* |
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; |
129 |
|
130 |
extern _X_EXPORT Bool CoreDump; |
131 |
|
132 |
diff --git a/os/utils.c b/os/utils.c |
133 |
index 51455cc..64810cf 100644 |
134 |
--- a/os/utils.c |
135 |
+++ b/os/utils.c |
136 |
@@ -502,6 +502,7 @@ void UseMsg(void) |
137 |
#endif |
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 |
@@ -841,6 +842,8 @@ ProcessCommandLine(int argc, char *argv[]) |
145 |
defaultBackingStore = WhenMapped; |
146 |
else if ( strcmp( argv[i], "-wr") == 0) |
147 |
whiteRoot = TRUE; |
148 |
+ else if ( strcmp( argv[i], "-nr") == 0) |
149 |
+ bgNoneRoot = TRUE; |
150 |
else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { |
151 |
if(++i < argc) { |
152 |
long reqSizeArg = atol(argv[i]); |
153 |
-- |
154 |
1.7.1 |
155 |
|