tImprove artefact cleaning on the root window - glazier - window management experiments
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 917e7b9aee94663cc46019b26eaec1d3c1c3060e
 (DIR) parent 155eb51908acbf193ac72350cc0f89599130c027
 (HTM) Author: Willy Goiffon <dev@z3bra.org>
       Date:   Tue,  2 Jun 2020 19:13:59 +0200
       
       Improve artefact cleaning on the root window
       
       This is done by limiting the number of expose events generated while
       drawing the outline, and forcing the root window to clear itself after
       we're done.
       
       Diffstat:
         M glazier.c                           |       7 ++++---
       
       1 file changed, 4 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/glazier.c b/glazier.c
       t@@ -223,10 +223,10 @@ outline(xcb_drawable_t wid, int x, int y, int w, int h)
                xcb_rectangle_t r;
        
                gc = xcb_generate_id(conn);
       -        mask = XCB_GC_FUNCTION | XCB_GC_LINE_WIDTH | XCB_GC_SUBWINDOW_MODE;
       +        mask = XCB_GC_FUNCTION | XCB_GC_SUBWINDOW_MODE | XCB_GC_GRAPHICS_EXPOSURES;
                val[0] = XCB_GX_INVERT;
       -        val[1] = 0;
       -        val[2] = XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS;
       +        val[1] = XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS,
       +        val[2] = 0;
                xcb_create_gc(conn, gc, wid, mask, val);
        
                /* redraw last rectangle to clear it */
       t@@ -451,6 +451,7 @@ cb_mouse_release(xcb_generic_event_t *ev)
        
                /* clear last drawn rectangle to avoid leaving artefacts */
                outline(scrn->root, 0, 0, 0, 0);
       +        xcb_clear_area(conn, 0, scrn->root, 0, 0, 0, 0);
        
                return 0;
        }