From 3e6626d6c3c876cd043c8589a59c448016bff377 Mon Sep 17 00:00:00 2001 From: rti Date: Sun, 4 Jun 2023 21:48:19 +0200 Subject: [PATCH] fix: consider dim introduced transparency for blur (#184) The blur rendering logic includes the optimization to render blur only for transparent surfaces. This patch considers surfaces as transparent also when the transparency is only introduced by the dim color. We can now have windows, that are opaque by default become transparent with blurred background as soon as they loose focus. Example configuration: ``` blur on blur_passes 3 blur_radius 5 default_dim_inactive 0.15 dim_inactive_colors.unfocused #00000000 ``` --- sway/desktop/render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index b9de2025..47449bb6 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -441,7 +441,7 @@ static void render_surface_iterator(struct sway_output *output, pixman_region32_init(&opaque_region); bool has_alpha = false; - if (deco_data.alpha < 1.0) { + if (deco_data.alpha < 1.0 || deco_data.dim_color[3] < 1.0) { has_alpha = true; pixman_region32_union_rect(&opaque_region, &opaque_region, 0, 0, 0, 0); } else {