From af8c480b06ea48d1fcd72d6e0a0bb62c373b2452 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 19 Nov 2025 11:36:38 +0800 Subject: [PATCH] opt: set fadein blur to no blur_optimize --- src/animation/client.h | 10 ++++++++++ src/animation/layer.h | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/animation/client.h b/src/animation/client.h index c4a21e7..aa17e0c 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -1146,6 +1146,16 @@ bool client_apply_focus_opacity(Client *c) { target_opacity = opacity; } client_set_opacity(c, target_opacity); + if (blur && !c->noblur && !blur_optimized) { + wlr_scene_blur_set_strength( + c->blur, MIN(percent * (1.0 - fadein_begin_opacity) + + fadein_begin_opacity, + 1.0)); + wlr_scene_blur_set_alpha( + c->blur, MIN(percent * (1.0 - fadein_begin_opacity) + + fadein_begin_opacity, + 1.0)); + } } else if (animations && c->opacity_animation.running) { struct timespec now; diff --git a/src/animation/layer.h b/src/animation/layer.h index 80caec5..aa9f047 100644 --- a/src/animation/layer.h +++ b/src/animation/layer.h @@ -326,9 +326,14 @@ void layer_animation_next_tick(LayerSurface *l) { animation_passed * (1.0 - fadein_begin_opacity), 1.0f); - if (animation_fade_in) + if (animation_fade_in) { + if (blur && !l->noblur && !blur_optimized) { + wlr_scene_blur_set_strength(l->blur, opacity); + wlr_scene_blur_set_alpha(l->blur, opacity); + } wlr_scene_node_for_each_buffer(&l->scene->node, scene_buffer_apply_opacity, &opacity); + } wlr_scene_node_set_position(&l->scene->node, x, y);