From 1d31a3ffb2234bd18a393efd0926a02b81425509 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 9ecc9b1..12892ba 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -2625,6 +2625,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 e91cfbd..790840e 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2538,6 +2538,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);