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 ```
This commit is contained in:
parent
6a6cf2841c
commit
3e6626d6c3
|
@ -441,7 +441,7 @@ static void render_surface_iterator(struct sway_output *output,
|
||||||
pixman_region32_init(&opaque_region);
|
pixman_region32_init(&opaque_region);
|
||||||
|
|
||||||
bool has_alpha = false;
|
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;
|
has_alpha = true;
|
||||||
pixman_region32_union_rect(&opaque_region, &opaque_region, 0, 0, 0, 0);
|
pixman_region32_union_rect(&opaque_region, &opaque_region, 0, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue