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>
This commit is contained in:
parent
8976e9766e
commit
da66119593
24
dix/window.c
24
dix/window.c
|
@ -956,6 +956,26 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||||
return Success;
|
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
|
* ChangeWindowAttributes
|
||||||
*
|
*
|
||||||
|
@ -1005,7 +1025,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
if (pWin->backgroundState == BackgroundPixmap)
|
if (pWin->backgroundState == BackgroundPixmap)
|
||||||
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
|
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
|
||||||
if (!pWin->parent)
|
if (!pWin->parent)
|
||||||
MakeRootTile(pWin);
|
SetRootWindowBackground(pWin, pScreen, &index2);
|
||||||
else {
|
else {
|
||||||
pWin->backgroundState = XaceBackgroundNoneState(pWin);
|
pWin->backgroundState = XaceBackgroundNoneState(pWin);
|
||||||
pWin->background.pixel = pScreen->whitePixel;
|
pWin->background.pixel = pScreen->whitePixel;
|
||||||
|
@ -1022,7 +1042,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
if (pWin->backgroundState == BackgroundPixmap)
|
if (pWin->backgroundState == BackgroundPixmap)
|
||||||
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
|
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
|
||||||
if (!pWin->parent)
|
if (!pWin->parent)
|
||||||
MakeRootTile(pWin);
|
SetRootWindowBackground(pWin, pScreen, &index2);
|
||||||
else
|
else
|
||||||
pWin->backgroundState = ParentRelative;
|
pWin->backgroundState = ParentRelative;
|
||||||
borderRelative = TRUE;
|
borderRelative = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue