From 1c1e4fdaf44fadd83d09077e4c1571ff559c8736 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 22 Aug 2018 23:33:10 +0200 Subject: [PATCH] desktop-shell: always paint background color first Only draw the background once, using the the current default background color or the user specified background color. This allows for non-filling background image implemenation while still using the specified background color. Signed-off-by: Stefan Agner --- clients/desktop-shell.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index fcc0b657..4d0b1d02 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -756,7 +756,10 @@ background_draw(struct widget *widget, void *data) cr = widget_cairo_create(background->widget); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - cairo_set_source_rgba(cr, 0.0, 0.0, 0.2, 1.0); + if (background->color == 0) + cairo_set_source_rgba(cr, 0.0, 0.0, 0.2, 1.0); + else + set_hex_color(cr, background->color); cairo_paint(cr); widget_get_allocation(widget, &allocation); @@ -802,8 +805,6 @@ background_draw(struct widget *widget, void *data) cairo_set_source(cr, pattern); cairo_pattern_destroy (pattern); cairo_surface_destroy(image); - } else { - set_hex_color(cr, background->color); } cairo_paint(cr);