From 17225685c19a64f8735476516834bc219a0b8dbb Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 27 Mar 2025 14:41:19 +0800 Subject: [PATCH] opt:Avoid the number of monitors affecting the animation speed --- maomao.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/maomao.c b/maomao.c index d78f16b..734867a 100644 --- a/maomao.c +++ b/maomao.c @@ -2194,7 +2194,15 @@ void client_set_pending_state(Client *c) { } double output_frame_duration_ms(Client *c) { - return 1000000.0 / c->mon->wlr_output->refresh; + int32_t refresh_total = 0; + Monitor *m; + wl_list_for_each(m, &mons, link) { + if (!m->wlr_output->enabled) { + continue; + } + refresh_total += m->wlr_output->refresh; + } + return 1000000.0 / refresh_total; } void client_commit(Client *c) {