[PATCH 2/2] dix: fix None root background behaviour for protocol calls
Ville Syrjälä
ville.syrjala at nokia.com
Tue Nov 9 07:37:19 PST 2010
On Tue, Nov 09, 2010 at 06:26:35PM +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.
>
> 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) {
This canDoBGNoneRoot check doesn't make sense to me since the video
driver doesn't need to do anything to make this work.
> + 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
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
--
Ville Syrjälä
More information about the xorg-devel
mailing list