From 6b83d4d7e9213e63b973e463e423f504f8f054bc Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 27 Jun 2026 19:07:59 +0800 Subject: [PATCH] opt: optimize dmps state --- src/mango.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mango.c b/src/mango.c index b3a5b48d..adbcdff4 100644 --- a/src/mango.c +++ b/src/mango.c @@ -6852,14 +6852,19 @@ void updatemons(struct wl_listener *listener, void *data) { /* First remove from the layout the disabled monitors */ wl_list_for_each(m, &mons, link) { - if (m->wlr_output->enabled || m->only_dpms_off) + if (m->wlr_output->enabled) continue; config_head = wlr_output_configuration_head_v1_create(output_config, m->wlr_output); config_head->state.enabled = 0; + + if (m->only_dpms_off) { + continue; + } /* Remove this output from the layout to avoid cursor enter inside * it */ wlr_output_layout_remove(output_layout, m->wlr_output); + closemon(m); m->m = m->w = (struct wlr_box){0}; }