From 15fc158dc4c91d713568f7e61dbff78c5fb7d69c Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 2 Sep 2025 10:45:43 +0800 Subject: [PATCH] opt: monitor rule fallback to custom mode --- src/config/parse_config.h | 4 ++++ src/mango.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 35589e7..a189248 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -2494,6 +2494,10 @@ void reapply_monitor_rules(void) { mr->height, mr->refresh); if (internal_mode) { wlr_output_state_set_mode(&state, internal_mode); + } else { + wlr_output_state_set_custom_mode( + &state, mr->width, mr->height, + (int)roundf(mr->refresh * 1000)); } } diff --git a/src/mango.c b/src/mango.c index bc1d674..63186a0 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2490,6 +2490,10 @@ void createmon(struct wl_listener *listener, void *data) { r->height, r->refresh); if (internal_mode) { wlr_output_state_set_mode(&state, internal_mode); + } else { + wlr_output_state_set_custom_mode( + &state, r->width, r->height, + (int)roundf(r->refresh * 1000)); } } wlr_output_state_set_scale(&state, r->scale);