1
1
mirror of https://github.com/swaywm/sway synced 2024-09-28 23:41:18 +02:00

Merge pull request #2699 from RedSoxFan/fix-2667

swaybg: fix increasingly smaller bg on hotplug
This commit is contained in:
emersion 2018-09-23 21:44:57 +02:00 committed by GitHub
commit 4a4f07ac25
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

@ -58,6 +58,7 @@ void render_background_image(cairo_t *cairo, cairo_surface_t *image,
double width = cairo_image_surface_get_width(image);
double height = cairo_image_surface_get_height(image);
cairo_save(cairo);
switch (mode) {
case BACKGROUND_MODE_STRETCH:
cairo_scale(cairo,
@ -116,4 +117,5 @@ void render_background_image(cairo_t *cairo, cairo_surface_t *image,
break;
}
cairo_paint(cairo);
cairo_restore(cairo);
}

@ -73,6 +73,10 @@ static void render_frame(struct swaybg_state *state) {
return;
}
cairo_t *cairo = state->current_buffer->cairo;
cairo_save(cairo);
cairo_set_operator(cairo, CAIRO_OPERATOR_CLEAR);
cairo_paint(cairo);
cairo_restore(cairo);
if (state->args->mode == BACKGROUND_MODE_SOLID_COLOR) {
cairo_set_source_u32(cairo, state->context.color);
cairo_paint(cairo);