[PATCH v2] dix: fix None root background behaviour for protocol calls
Ville Syrjälä
ville.syrjala at nokia.com
Tue Nov 9 10:45:32 PST 2010
On Tue, Nov 09, 2010 at 06:03:02PM +0100, Vignatti Tiago (Nokia-MS/Helsinki) wrote:
> On Tue, Nov 09, 2010 at 06:56:52PM +0200, Ville Syrj�l� wrote:
> > On Tue, Nov 09, 2010 at 07:42:05PM +0100, Vignatti Tiago (Nokia-MS/Helsinki) wrote:
> > > 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 if (whiteRoot) ...
> >
> > just like in InitRootWindow()?
> >
> > Also AFAIK ParentRelative and None should behave the same way for the
> > root window.
>
> they are already behaving accordingly with this patch applied. Those cases are
> already caught by CWBackPixel inside ChangeWindowAttributes. The one being
> changed now is CWBackPixmap.
Forget about changing the background pixel via CWBackPixel. That
operation is not relevant to this patch.
Setting the root window's background pixmap to None or ParentRelative
should restore the default background. Whether that default happens to
be BlackPixel, WhitePixel or the root tile pixmap doesn't matter.
--
Ville Syrjälä
More information about the xorg-devel
mailing list