diff --git a/src/animation/client.h b/src/animation/client.h index 79544cd2..faae4a56 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -1293,6 +1293,10 @@ void resize(Client *c, struct wlr_box geo, int32_t interact) { if (!c->mon) return; + if (config.blur && c->mon->blur) { + wlr_scene_optimized_blur_mark_dirty(c->mon->blur); + } + c->need_output_flush = true; c->dirty = true; diff --git a/src/mango.c b/src/mango.c index 26eb0769..865d8f50 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5128,6 +5128,7 @@ void rendermon(struct wl_listener *listener, void *data) { bool frame_allow_tearing = false; struct timespec now; bool need_more_frames = false; + bool need_blur_dirty = false; // dirty the blur buffer if (session && !session->active) { return; @@ -5143,20 +5144,24 @@ void rendermon(struct wl_listener *listener, void *data) { layer_list = &m->layers[i]; wl_list_for_each_safe(l, tmpl, layer_list, link) { need_more_frames = layer_draw_frame(l) || need_more_frames; + if (l->animation.running) need_blur_dirty = true; } } wl_list_for_each_safe(c, tmp, &fadeout_clients, fadeout_link) { need_more_frames = client_draw_fadeout_frame(c) || need_more_frames; + if (l->animation.running) need_blur_dirty = true; } wl_list_for_each_safe(l, tmpl, &fadeout_layers, fadeout_link) { need_more_frames = layer_draw_fadeout_frame(l) || need_more_frames; + if (l->animation.running) need_blur_dirty = true; } // 绘制客户端 wl_list_for_each(c, &clients, link) { need_more_frames = client_draw_frame(c) || need_more_frames; + if (l->animation.running) need_blur_dirty = true; if (!config.animations && !grabc && c->configure_serial && client_is_rendered_on_mon(c, m)) { monitor_check_skip_frame_timeout(m); @@ -5168,6 +5173,10 @@ void rendermon(struct wl_listener *listener, void *data) { monitor_stop_skip_frame_timer(m); } + if (config.blur && m->blur && (need_blur_dirty || need_more_frames)) { + wlr_scene_optimized_blur_mark_dirty(m->blur); + } + // 只有在需要帧时才构建和提交状态 if (config.allow_tearing && frame_allow_tearing) { apply_tear_state(m);