summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-11-10 21:48:04 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-11-11 23:25:06 +0200
commitda66119593b63ef82ae6fa2e034ccd0856b03a80 (patch)
treec1f2e0d78be015e427fbf0daf299c56e5f083135
parent8976e9766edfb33f5cf3f6d54f09e46d29bc4ec5 (diff)
dix: fix root window background behaviour for protocol calls
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 <tiago.vignatti@nokia.com> Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
-rw-r--r--dix/window.c24
1 files changed, 22 insertions, 2 deletions
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;