From da66119593b63ef82ae6fa2e034ccd0856b03a80 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Wed, 10 Nov 2010 21:48:04 +0200 Subject: dix: fix root window background behaviour for protocol calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead always paint root tiled (-retro like), protocol calls (XSetWindowBackgroundPixmap and related) should behave accordingly when None and ParentRelative 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 Signed-off-by: Ville Syrjälä Reviewed-by: Rami Ylimäki --- dix/window.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'dix') diff --git a/dix/window.c b/dix/window.c index e1bdd8b7c..d140ddade 100644 --- a/dix/window.c +++ b/dix/window.c @@ -956,6 +956,26 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client) return Success; } +static void +SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2) +{ + /* following the protocol: "Changing the background of a root window to + * None or ParentRelative restores the default background pixmap" */ + if (bgNoneRoot) { + pWin->backgroundState = XaceBackgroundNoneState(pWin); + pWin->background.pixel = pScreen->whitePixel; + } + else if (party_like_its_1989) + MakeRootTile(pWin); + else { + if (whiteRoot) + pWin->background.pixel = pScreen->whitePixel; + else + pWin->background.pixel = pScreen->blackPixel; + *index2 = CWBackPixel; + } +} + /***** * ChangeWindowAttributes * @@ -1005,7 +1025,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap)(pWin->background.pixmap); if (!pWin->parent) - MakeRootTile(pWin); + SetRootWindowBackground(pWin, pScreen, &index2); else { pWin->backgroundState = XaceBackgroundNoneState(pWin); pWin->background.pixel = pScreen->whitePixel; @@ -1022,7 +1042,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap)(pWin->background.pixmap); if (!pWin->parent) - MakeRootTile(pWin); + SetRootWindowBackground(pWin, pScreen, &index2); else pWin->backgroundState = ParentRelative; borderRelative = TRUE; -- cgit v1.2.3