Changes to the root background pixmap would previously cause the new
image to flicker into visibility briefy before windows were redrawn
over it.  This patch fixes this by dropping a XClearWindow call and
providing a new function ("damage_screen") to force a redraw of the
entire screen.

Signed-off-by: Forest Bond <[email protected]>
---
 xcompmgr.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/xcompmgr.c b/xcompmgr.c
index 3a01cce..47f5667 100644
--- a/xcompmgr.c
+++ b/xcompmgr.c
@@ -128,6 +128,7 @@ static int          composite_event, composite_error;
 static int             render_event, render_error;
 static Bool            synchronize;
 static int             composite_opcode;
+static Bool            screen_damaged = False;
 
 /* find these once and be done with it */
 static Atom            opacityAtom;
@@ -947,7 +948,7 @@ paint_all (Display *dpy, XserverRegion region)
            continue;
 #endif
        /* never painted, ignore it */
-       if (!w->damaged)
+       if ((!screen_damaged) && (!w->damaged))
            continue;
        /* if invisible, ignore it */
        if (w->a.x + w->a.width < 1 || w->a.y + w->a.height < 1
@@ -1120,6 +1121,7 @@ paint_all (Display *dpy, XserverRegion region)
        XRenderComposite (dpy, PictOpSrc, rootBuffer, None, rootPicture,
                          0, 0, 0, 0, 0, 0, root_width, root_height);
     }
+    screen_damaged = False;
 }
 
 static void
@@ -1738,6 +1740,22 @@ damage_win (Display *dpy, XDamageNotifyEvent *de)
        repair_win (dpy, w);
 }
 
+static void
+damage_screen (Display *dpy)
+{
+       XserverRegion region;
+       XRectangle r;
+
+       r.x = 0;
+       r.y = 0;
+       r.width = root_width;
+       r.height = root_height;
+
+       region = XFixesCreateRegion (dpy, &r, 1);
+       add_damage (dpy, region);
+       screen_damaged = True;
+}
+
 static int
 error (Display *dpy, XErrorEvent *ev)
 {
@@ -2193,9 +2211,10 @@ main (int argc, char **argv)
                    {
                        if (rootTile)
                        {
-                           XClearArea (dpy, root, 0, 0, 0, 0, True);
                            XRenderFreePicture (dpy, rootTile);
                            rootTile = None;
+
+                           damage_screen(dpy);
                            break;
                        }
                    }
@@ -2232,12 +2251,13 @@ main (int argc, char **argv)
        } while (QLength (dpy));
        if (allDamage && !autoRedirect)
        {
-           static int  paint;
            paint_all (dpy, allDamage);
-           paint++;
            XSync (dpy, False);
            allDamage = None;
            clipChanged = False;
        }
     }
+
+    XClearArea (dpy, root, 0, 0, 0, 0, True);
+    XSync (dpy, False);
 }
-- 
1.7.0.4

Attachment: signature.asc
Description: Digital signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to