aboutsummaryrefslogtreecommitdiff
path: root/swaylock/render.c
diff options
context:
space:
mode:
authorBor Grošelj Simić <bor.groseljsimic@telemach.net>2018-07-04 12:09:05 +0200
committerBor Grošelj Simić <bor.groseljsimic@telemach.net>2018-07-04 12:09:05 +0200
commit484042efd8a7f3dd85a763f9ecdda01e5a798693 (patch)
tree8c0acb61537bc4ab2a88c1790afb35f505733407 /swaylock/render.c
parent1d0963737ea1e7e1a2143fef213596b25908e7fe (diff)
Fix transparency in background images in swaylock
Diffstat (limited to 'swaylock/render.c')
-rw-r--r--swaylock/render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/swaylock/render.c b/swaylock/render.c
index 80377b2a..ea23d0d8 100644
--- a/swaylock/render.c
+++ b/swaylock/render.c
@@ -30,15 +30,16 @@ void render_frame(struct swaylock_surface *surface) {
cairo_t *cairo = surface->current_buffer->cairo;
cairo_identity_matrix(cairo);
+ 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.color);
- cairo_set_operator (cairo, CAIRO_OPERATOR_SOURCE);
cairo_paint(cairo);
- cairo_set_operator (cairo, CAIRO_OPERATOR_OVER);
} else {
render_background_image(cairo, surface->image,
state->args.mode, buffer_width, buffer_height);
}
+ cairo_restore(cairo);
cairo_identity_matrix(cairo);
int arc_radius = ARC_RADIUS * surface->scale;