summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRutherther <rutherther@proton.me>2024-05-14 17:57:59 +0200
committerLeonardo Hernández Hernández <leohdz172@proton.me>2024-06-20 17:49:29 -0600
commit11baacbec0b75dff34abf52d5172687e4ae2cc4f (patch)
treed24fc44294c587ec5062b4e8ba6b0c612aae1309
parent16076ec5a40ed708b99f27100036a4a92b4fdd59 (diff)
Add output to layout after enabled state is committed
-rw-r--r--dwl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/dwl.c b/dwl.c
index 83bdbe4..60b74ae 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1906,11 +1906,6 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test)
config_head->state.custom_mode.height,
config_head->state.custom_mode.refresh);
- /* Don't move monitors if position wouldn't change, this to avoid
- * wlroots marking the output as manually configured */
- if (m->m.x != config_head->state.x || m->m.y != config_head->state.y)
- wlr_output_layout_add(output_layout, wlr_output,
- config_head->state.x, config_head->state.y);
wlr_output_state_set_transform(&state, config_head->state.transform);
wlr_output_state_set_scale(&state, config_head->state.scale);
wlr_output_state_set_adaptive_sync_enabled(&state,
@@ -1920,6 +1915,13 @@ apply_or_test:
ok &= test ? wlr_output_test_state(wlr_output, &state)
: wlr_output_commit_state(wlr_output, &state);
+ /* Don't move monitors if position wouldn't change, this to avoid
+ * wlroots marking the output as manually configured.
+ * wlr_output_layout_add does not like disabled outputs */
+ if (!test && wlr_output->enabled && (m->m.x != config_head->state.x || m->m.y != config_head->state.y))
+ wlr_output_layout_add(output_layout, wlr_output,
+ config_head->state.x, config_head->state.y);
+
wlr_output_state_finish(&state);
}