From 057a63527969598ad2301a1df5f5589c8e63cce5 Mon Sep 17 00:00:00 2001 From: Tristan Giles Date: Sun, 3 Jan 2021 00:36:43 -0800 Subject: [PATCH] Clear framebuffer before drawing borders (#4308) Clear framebuffer before copying surface to prevent visual garbage Fixes #3481 Corrects problems of #4280 --- src/x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/x.c b/src/x.c index 48af5f37..ad9a3ff3 100644 --- a/src/x.c +++ b/src/x.c @@ -535,6 +535,10 @@ void x_draw_decoration(Con *con) { con->pixmap_recreated = false; con->mark_changed = false; + /* Clear background before drawing. Clearing here makes sure we are in a + * state where we are expected to redraw the borders */ + draw_util_clear_surface(&(con->frame_buffer), (color_t){.red = 0.0, .green = 0.0, .blue = 0.0}); + /* 2: draw the client.background, but only for the parts around the window_rect */ if (con->window != NULL) { /* top area */