From c2b99768e9bdaa4b1ef5ac8ca77080ea690b57b4 Mon Sep 17 00:00:00 2001 From: Dominik Bendle Date: Tue, 22 Jan 2019 21:00:01 +0100 Subject: Allow setting both background image and colour The -c/--color option no longer sets BACKGROUND_MODE_SOLID_COLOR (which disables the background image) and the background color is now set in all cases. One can still use --scaling solid_color to disable display of a background image. As a consequence, there is now only one possible default background colour (white), regardless of whether a background image is given or not. --- render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 1652a5e..100e739 100644 --- a/render.c +++ b/render.c @@ -59,10 +59,10 @@ void render_frame(struct swaylock_surface *surface) { cairo_save(cairo); cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE); - if (state->args.mode == BACKGROUND_MODE_SOLID_COLOR || !surface->image) { - cairo_set_source_u32(cairo, state->args.colors.background); - cairo_paint(cairo); - } else { + cairo_set_source_u32(cairo, state->args.colors.background); + cairo_paint(cairo); + if (surface->image && state->args.mode != BACKGROUND_MODE_SOLID_COLOR) { + cairo_set_operator(cairo, CAIRO_OPERATOR_OVER); render_background_image(cairo, surface->image, state->args.mode, buffer_width, buffer_height); } -- cgit v1.2.3