]>
Commit | Line | Data |
---|---|---|
313ed234 SS |
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 | |
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 c24a94f..907a5e8 100644 | |
17 | --- a/dix/globals.c | |
18 | +++ b/dix/globals.c | |
19 | @@ -124,6 +124,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 | int cursorScreenDevPriv[MAXSCREENS]; | |
26 | ||
27 | diff --git a/dix/window.c b/dix/window.c | |
28 | index caff1cb..be1d1c4 100644 | |
29 | --- a/dix/window.c | |
30 | +++ b/dix/window.c | |
31 | @@ -466,22 +466,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 6707448..776b898 100644 | |
63 | --- a/hw/xfree86/common/xf86Init.c | |
64 | +++ b/hw/xfree86/common/xf86Init.c | |
65 | @@ -77,6 +77,7 @@ | |
66 | #ifdef RENDER | |
67 | #include "picturestr.h" | |
68 | #endif | |
69 | +#include "xace.h" | |
70 | ||
71 | #include "xf86VGAarbiter.h" | |
72 | #include "globals.h" | |
73 | @@ -254,6 +255,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 | @@ -305,6 +307,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 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; | |
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 | @@ -775,6 +775,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 d7c8388..40583d0 100644 | |
134 | --- a/os/utils.c | |
135 | +++ b/os/utils.c | |
136 | @@ -513,6 +513,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 | @@ -856,6 +857,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.6.6 | |
155 |