diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 8074630e..403e2dae 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -202,8 +202,8 @@ void output_layer_for_each_toplevel_surface(struct sway_output *output, struct fx_render_data *data = user_data; struct layer_effects *effects = layer_surface->effects; if (effects) { - data->deco_data.blur = effects->blur && config->blur_enabled; - data->deco_data.shadow = effects->shadow && config->shadow_enabled; + data->deco_data.blur = effects->blur; + data->deco_data.shadow = effects->shadow; data->deco_data.corner_radius = effects->corner_rounding? config->corner_radius: 0; } diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 444bd8e8..de304a15 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -1775,6 +1775,39 @@ static struct workspace_effect_info get_workspace_effect_info(struct sway_output }; workspace_find_container(workspace, find_con_effect_iterator, &iter_data); + if (effect_info.container_wants_blur + && effect_info.container_wants_shadow + && effect_info.should_render_optimized_blur) { + goto end; + } + + // Check if any layer-shell surfaces will render effects + size_t len = sizeof(sway_output->layers) / sizeof(sway_output->layers[0]); + for (size_t i = 0; i < len; ++i) { + struct sway_layer_surface *lsurface; + wl_list_for_each(lsurface, &sway_output->layers[i], link) { + struct layer_effects *layer_effects = lsurface->effects; + if (layer_effects) { + if (layer_effects->blur && !lsurface->layer_surface->surface->opaque) { + effect_info.container_wants_blur = true; + // Check if we should render optimized blur + if (renderer->blur_buffer_dirty && config->blur_xray) { + effect_info.should_render_optimized_blur = true; + } + } + if (layer_effects->shadow) { + effect_info.container_wants_shadow = true; + } + } + if (effect_info.container_wants_blur + && effect_info.container_wants_shadow + && effect_info.should_render_optimized_blur) { + goto end; + } + } + } + +end:; // Set the expanded damage region bool shadow_enabled = effect_info.container_wants_shadow || config->shadow_enabled; int shadow_sigma = shadow_enabled ? config->shadow_blur_sigma : 0;