Fix transparency in background images in swaylock
This commit is contained in:
parent
175c21d36d
commit
0978661a1b
5
render.c
5
render.c
@ -30,15 +30,16 @@ void render_frame(struct swaylock_surface *surface) {
|
|||||||
cairo_t *cairo = surface->current_buffer->cairo;
|
cairo_t *cairo = surface->current_buffer->cairo;
|
||||||
cairo_identity_matrix(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) {
|
if (state->args.mode == BACKGROUND_MODE_SOLID_COLOR || !surface->image) {
|
||||||
cairo_set_source_u32(cairo, state->args.color);
|
cairo_set_source_u32(cairo, state->args.color);
|
||||||
cairo_set_operator (cairo, CAIRO_OPERATOR_SOURCE);
|
|
||||||
cairo_paint(cairo);
|
cairo_paint(cairo);
|
||||||
cairo_set_operator (cairo, CAIRO_OPERATOR_OVER);
|
|
||||||
} else {
|
} else {
|
||||||
render_background_image(cairo, surface->image,
|
render_background_image(cairo, surface->image,
|
||||||
state->args.mode, buffer_width, buffer_height);
|
state->args.mode, buffer_width, buffer_height);
|
||||||
}
|
}
|
||||||
|
cairo_restore(cairo);
|
||||||
cairo_identity_matrix(cairo);
|
cairo_identity_matrix(cairo);
|
||||||
|
|
||||||
int arc_radius = ARC_RADIUS * surface->scale;
|
int arc_radius = ARC_RADIUS * surface->scale;
|
||||||
|
Loading…
Reference in New Issue
Block a user