2009-06-03 00:58:26 +02:00
|
|
|
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(-)
|
|
|
|
|
2010-04-13 21:08:39 +02:00
|
|
|
Index: xorg-server-1.6.3/dix/globals.c
|
2009-08-04 21:52:16 +02:00
|
|
|
===================================================================
|
2010-04-13 21:08:39 +02:00
|
|
|
--- xorg-server-1.6.3.orig/dix/globals.c
|
|
|
|
+++ xorg-server-1.6.3/dix/globals.c
|
|
|
|
@@ -141,6 +141,7 @@ FontPtr defaultFont; /* not declared i
|
2009-06-03 00:58:26 +02:00
|
|
|
CursorPtr rootCursor;
|
|
|
|
Bool party_like_its_1989 = FALSE;
|
|
|
|
Bool whiteRoot = FALSE;
|
|
|
|
+Bool bgNoneRoot = FALSE;
|
|
|
|
|
|
|
|
int cursorScreenDevPriv[MAXSCREENS];
|
|
|
|
|
2010-04-13 21:08:39 +02:00
|
|
|
Index: xorg-server-1.6.3/dix/window.c
|
2009-08-04 21:52:16 +02:00
|
|
|
===================================================================
|
2010-04-13 21:08:39 +02:00
|
|
|
--- xorg-server-1.6.3.orig/dix/window.c
|
|
|
|
+++ xorg-server-1.6.3/dix/window.c
|
|
|
|
@@ -479,23 +479,24 @@ InitRootWindow(WindowPtr pWin)
|
2009-06-03 00:58:26 +02:00
|
|
|
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);
|
|
|
|
}
|
2010-04-13 21:08:39 +02:00
|
|
|
Index: xorg-server-1.6.3/hw/xfree86/common/xf86Init.c
|
2009-08-04 21:52:16 +02:00
|
|
|
===================================================================
|
2010-04-13 21:08:39 +02:00
|
|
|
--- xorg-server-1.6.3.orig/hw/xfree86/common/xf86Init.c
|
|
|
|
+++ xorg-server-1.6.3/hw/xfree86/common/xf86Init.c
|
|
|
|
@@ -79,6 +79,7 @@
|
2009-06-03 00:58:26 +02:00
|
|
|
#ifdef RENDER
|
|
|
|
#include "picturestr.h"
|
|
|
|
#endif
|
|
|
|
+#include "xace.h"
|
|
|
|
|
|
|
|
#include "globals.h"
|
2010-04-13 21:08:39 +02:00
|
|
|
|
|
|
|
@@ -328,6 +329,7 @@ xf86CreateRootWindow(WindowPtr pWin)
|
2009-06-03 00:58:26 +02:00
|
|
|
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);
|
2010-04-13 21:08:39 +02:00
|
|
|
@@ -381,6 +383,15 @@ xf86CreateRootWindow(WindowPtr pWin)
|
2009-06-03 00:58:26 +02:00
|
|
|
}
|
|
|
|
}
|
2010-04-08 16:20:29 +02:00
|
|
|
|
2010-04-13 21:08:39 +02:00
|
|
|
+ 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
|
|
|
|
Index: xorg-server-1.6.3/hw/xfree86/common/xf86str.h
|
2009-08-04 21:52:16 +02:00
|
|
|
===================================================================
|
2010-04-13 21:08:39 +02:00
|
|
|
--- xorg-server-1.6.3.orig/hw/xfree86/common/xf86str.h
|
|
|
|
+++ xorg-server-1.6.3/hw/xfree86/common/xf86str.h
|
|
|
|
@@ -531,7 +531,7 @@ typedef struct _confdrirec {
|
2009-06-03 00:58:26 +02:00
|
|
|
} confDRIRec, *confDRIPtr;
|
|
|
|
|
|
|
|
/* These values should be adjusted when new fields are added to ScrnInfoRec */
|
|
|
|
-#define NUM_RESERVED_INTS 16
|
|
|
|
+#define NUM_RESERVED_INTS 15
|
2010-04-13 21:08:39 +02:00
|
|
|
#define NUM_RESERVED_POINTERS 15
|
2009-06-03 00:58:26 +02:00
|
|
|
#define NUM_RESERVED_FUNCS 11
|
|
|
|
|
2010-04-13 21:08:39 +02:00
|
|
|
@@ -959,6 +959,9 @@ typedef struct _ScrnInfoRec {
|
|
|
|
ClockRangesPtr clockRanges;
|
2009-06-03 00:58:26 +02:00
|
|
|
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
|
2010-04-13 21:08:39 +02:00
|
|
|
Index: xorg-server-1.6.3/include/opaque.h
|
2009-08-04 21:52:16 +02:00
|
|
|
===================================================================
|
2010-04-13 21:08:39 +02:00
|
|
|
--- xorg-server-1.6.3.orig/include/opaque.h
|
|
|
|
+++ xorg-server-1.6.3/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;
|
2009-06-03 00:58:26 +02:00
|
|
|
|
2010-04-13 21:08:39 +02:00
|
|
|
extern Bool CoreDump;
|
2009-06-03 00:58:26 +02:00
|
|
|
|
2010-04-13 21:08:39 +02:00
|
|
|
Index: xorg-server-1.6.3/os/utils.c
|
2009-08-04 21:52:16 +02:00
|
|
|
===================================================================
|
2010-04-13 21:08:39 +02:00
|
|
|
--- xorg-server-1.6.3.orig/os/utils.c
|
|
|
|
+++ xorg-server-1.6.3/os/utils.c
|
|
|
|
@@ -515,6 +515,7 @@ void UseMsg(void)
|
2009-06-03 00:58:26 +02: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");
|
2010-04-13 21:08:39 +02:00
|
|
|
@@ -859,6 +860,8 @@ ProcessCommandLine(int argc, char *argv[
|
2009-06-03 00:58:26 +02: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]);
|