summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrti <[email protected]>2023-06-04 21:48:19 +0200
committerGitHub <[email protected]>2023-06-04 15:48:19 -0400
commit3e6626d6c3c876cd043c8589a59c448016bff377 (patch)
tree0b4b7b70c437110d5a560bad761ccd15a7e9f4ef
parent6a6cf2841c4bb83f45015067d5bd503be1ab0188 (diff)
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 ```
-rw-r--r--sway/desktop/render.c2
1 files changed, 1 insertions, 1 deletions
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 {