From d05c2755c3371a636ff74df43320427e0f84d656 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 17 Sep 2025 11:01:20 +0800 Subject: [PATCH] opt: only use custom-mode in headless monitor in monitorrule --- src/config/parse_config.h | 2 +- src/mango.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 0e93a3c..d102ef6 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -2741,7 +2741,7 @@ void reapply_monitor_rules(void) { mr->height, mr->refresh); if (internal_mode) { wlr_output_state_set_mode(&state, internal_mode); - } else { + } else if (wlr_output_is_headless(m->wlr_output)) { 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 46f5225..4a6e546 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2579,12 +2579,13 @@ void createmon(struct wl_listener *listener, void *data) { rr = r->rr; if (r->width > 0 && r->height > 0 && r->refresh > 0) { - custom_monitor_mode = true; internal_mode = get_output_mode(m->wlr_output, r->width, r->height, r->refresh); if (internal_mode) { + custom_monitor_mode = true; wlr_output_state_set_mode(&state, internal_mode); - } else { + } else if (wlr_output_is_headless(m->wlr_output)) { + custom_monitor_mode = true; wlr_output_state_set_custom_mode( &state, r->width, r->height, (int)roundf(r->refresh * 1000));