summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-1.5.0-bg-none-root.patch
blob: ef53689bd00e838a2c1f38ace1a1d50f7f8e785b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
From a3e15680da24cb8259f6a83dee0c930dab024290 Mon Sep 17 00:00:00 2001
From: Kristian <krh@redhat.com>
Date: Fri, 15 Aug 2008 15:15:14 +1000
Subject: [PATCH] Add nr for background=none root

---
 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(-)

diff --git a/dix/globals.c b/dix/globals.c
index 973dc43..dbd76bb 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -141,6 +141,7 @@ FontPtr defaultFont;   /* not declared in dix.h to avoid including font.h in
 CursorPtr rootCursor;
 Bool party_like_its_1989 = FALSE;
 Bool whiteRoot = FALSE;
+Bool bgNoneRoot = FALSE;
 
 int cursorScreenDevPriv[MAXSCREENS];
 
diff --git a/dix/window.c b/dix/window.c
index c31fa87..8bb178d 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -482,23 +482,24 @@ InitRootWindow(WindowPtr pWin)
     pWin->cursorIsNone = FALSE;
     pWin->optional->cursor = rootCursor;
     rootCursor->refcnt++;
-
+    pWin->backingStore = defaultBackingStore;
+    pWin->forcedBS = (defaultBackingStore != NotUseful);
 
     if (party_like_its_1989) {
         MakeRootTile(pWin);
         backFlag |= CWBackPixmap;
+        pScreen->ChangeWindowAttributes(pWin, backFlag);
+    } else if (bgNoneRoot) {
+	/* nothing, handled in xf86CreateRootWindow */
     } else {
 	if (whiteRoot)
             pWin->background.pixel = pScreen->whitePixel;
         else
             pWin->background.pixel = pScreen->blackPixel;
         backFlag |= CWBackPixel;
-    } 
 
-    pWin->backingStore = defaultBackingStore;
-    pWin->forcedBS = (defaultBackingStore != NotUseful);
-    /* We SHOULD check for an error value here XXX */
-    (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
+        pScreen->ChangeWindowAttributes(pWin, backFlag);
+    }
 
     MapWindow(pWin, serverClient);
 }
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 236c00b..083a6ac 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -79,6 +79,7 @@
 #ifdef RENDER
 #include "picturestr.h"
 #endif
+#include "xace.h"
 
 #include "globals.h"
 
@@ -328,6 +329,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);
@@ -381,6 +383,15 @@ xf86CreateRootWindow(WindowPtr pWin)
     }
   }
 
+  if (bgNoneRoot && pScrn->canDoBGNoneRoot || 1) {
+      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 904c369..8c38f69 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -531,7 +531,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
 
@@ -959,6 +959,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
diff --git a/include/opaque.h b/include/opaque.h
index 07a0715..be1577b 100644
--- a/include/opaque.h
+++ b/include/opaque.h
@@ -71,6 +71,7 @@ extern Bool defeatAccessControl;
 extern long maxBigRequestSize;
 extern Bool party_like_its_1989;
 extern Bool whiteRoot;
+extern Bool bgNoneRoot;
 
 extern Bool CoreDump;
 
diff --git a/os/utils.c b/os/utils.c
index b100949..c41b45b 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -515,6 +515,7 @@ void UseMsg(void)
 #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");
@@ -859,6 +860,8 @@ ProcessCommandLine(int argc, char *argv[])
 	    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]);
-- 
1.5.3.4