[PATCH v2] dix: fix None root background behaviour for protocol calls

Tiago Vignatti tiago.vignatti at nokia.com
Tue Nov 9 10:42:05 PST 2010


Instead always paint root tiled (-retro like), protocol calls
(XSetWindowBackgroundPixmap and related) should behave accordingly when None
is set as background pixmap.

It follow what the protocol states: "changing the background of a root window
to None or ParentRelative restores the default background pixmap".

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
changes from v1:
- remove canDoBGNoneRoot check (kudos to Ville)
- restores always the default background pixmap (kudos to Rami)

 dix/window.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dix/window.c b/dix/window.c
index bfaa6f5..77172a0 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -1004,8 +1004,14 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
 	    {
 		if (pWin->backgroundState == BackgroundPixmap)
 		    (*pScreen->DestroyPixmap)(pWin->background.pixmap);
-		if (!pWin->parent)
-		    MakeRootTile(pWin);
+		if (!pWin->parent) {
+		    if (bgNoneRoot) {
+			pWin->backgroundState = XaceBackgroundNoneState(pWin);
+			pWin->background.pixel = pScreen->whitePixel;
+		    }
+		    else if (party_like_its_1989)
+			MakeRootTile(pWin);
+		}
 		else {
 		    pWin->backgroundState = XaceBackgroundNoneState(pWin);
 		    pWin->background.pixel = pScreen->whitePixel;
-- 
1.7.0.4



More information about the xorg-devel mailing list