Unlinked layer-shell blur/shadows and their config counterparts
This commit is contained in:
parent
9bf5ab7f97
commit
330be7933a
2 changed files with 35 additions and 2 deletions
|
@ -202,8 +202,8 @@ void output_layer_for_each_toplevel_surface(struct sway_output *output,
|
||||||
struct fx_render_data *data = user_data;
|
struct fx_render_data *data = user_data;
|
||||||
struct layer_effects *effects = layer_surface->effects;
|
struct layer_effects *effects = layer_surface->effects;
|
||||||
if (effects) {
|
if (effects) {
|
||||||
data->deco_data.blur = effects->blur && config->blur_enabled;
|
data->deco_data.blur = effects->blur;
|
||||||
data->deco_data.shadow = effects->shadow && config->shadow_enabled;
|
data->deco_data.shadow = effects->shadow;
|
||||||
data->deco_data.corner_radius = effects->corner_rounding? config->corner_radius: 0;
|
data->deco_data.corner_radius = effects->corner_rounding? config->corner_radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
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
|
// Set the expanded damage region
|
||||||
bool shadow_enabled = effect_info.container_wants_shadow || config->shadow_enabled;
|
bool shadow_enabled = effect_info.container_wants_shadow || config->shadow_enabled;
|
||||||
int shadow_sigma = shadow_enabled ? config->shadow_blur_sigma : 0;
|
int shadow_sigma = shadow_enabled ? config->shadow_blur_sigma : 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue