From 157a824d0a30927d6c617357adce968affda38d2 Mon Sep 17 00:00:00 2001
From: Stefan Agner <stefan@agner.ch>
Date: Wed, 22 Aug 2018 23:33:10 +0200
Subject: [PATCH 1/3] 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 <stefan@agner.ch>
---
 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 fcc0b65..4d0b1d0 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);
-- 
2.7.4

