feat: add custom option to monitorrule

This commit is contained in:
DreamMaoMao 2026-03-06 18:21:49 +08:00
parent dcea22bfda
commit b1875f4663
2 changed files with 11 additions and 4 deletions

View file

@ -2846,7 +2846,7 @@ void createmon(struct wl_listener *listener, void *data) {
struct wlr_output *wlr_output = data;
const ConfigMonitorRule *r;
uint32_t i;
int32_t ji, vrr;
int32_t ji, vrr, custom;
struct wlr_output_state state;
Monitor *m = NULL;
struct wlr_output_mode *internal_mode = NULL;
@ -2938,6 +2938,7 @@ void createmon(struct wl_listener *listener, void *data) {
m->m.x = r->x == INT32_MAX ? INT32_MAX : r->x;
m->m.y = r->y == INT32_MAX ? INT32_MAX : r->y;
vrr = r->vrr >= 0 ? r->vrr : 0;
custom = r->custom >= 0 ? r->custom : 0;
scale = r->scale;
rr = r->rr;
@ -2947,7 +2948,7 @@ void createmon(struct wl_listener *listener, void *data) {
if (internal_mode) {
custom_monitor_mode = true;
wlr_output_state_set_mode(&state, internal_mode);
} else if (wlr_output_is_headless(m->wlr_output)) {
} else if (custom || wlr_output_is_headless(m->wlr_output)) {
custom_monitor_mode = true;
wlr_output_state_set_custom_mode(
&state, r->width, r->height,