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

Tiago Vignatti tiago.vignatti at nokia.com
Tue Nov 9 09:26:35 PST 2010


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

Now, even if the server is started without "-background none", the user can
set the root background to None, which will have the same behaviour as that
option.

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---

It may help you: my test case is using the program below, plus some mixes of
killing forced the server and starting up some basic client to see whether the
root background keeps there or now.

    #include <X11/Xlib.h>

    int main (void) {
        Display *dpy;
        Window w;

        dpy = XOpenDisplay(NULL);
        w = XRootWindow(dpy, DefaultScreen(dpy));

        XSetWindowBackgroundPixmap(dpy, w, None);

        XClearWindow(dpy, w);
        XFlush(dpy);

        XCloseDisplay(dpy);
        return 0;
    }

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

diff --git a/dix/window.c b/dix/window.c
index bfaa6f5..ab62973 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 (pScreen->canDoBGNoneRoot) {
+			bgNoneRoot = TRUE;
+			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