aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-09-10 23:45:57 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-09-10 23:54:57 -0500
commitba7dcb2dea2d5dc46b73b6b9194daab94a325a05 (patch)
tree2c84353c4322eeb882d3f9ef1be419562466d8ca
parentc8a9f634515cbf5a943a982bb4b603682c0eca22 (diff)
don't try to move outputs when its x,y hasn't change
when using wlr_output_layout_move() wlroots internally change the state of the output to manually configured and when updating the layout these outputs aren't ignored by wlroots, leaving us at our own
-rw-r--r--dwl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index 09e60ec..8557540 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1607,6 +1607,7 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test)
/* Then enable outputs that need to */
wl_list_for_each(config_head, &config->heads, link) {
struct wlr_output *wlr_output = config_head->state.output;
+ Monitor *m = wlr_output->data;
if (!config_head->state.enabled)
continue;
@@ -1619,8 +1620,11 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test)
config_head->state.custom_mode.height,
config_head->state.custom_mode.refresh);
- wlr_output_layout_move(output_layout, wlr_output,
- config_head->state.x, config_head->state.y);
+ /* 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_move(output_layout, wlr_output,
+ config_head->state.x, config_head->state.y);
wlr_output_set_transform(wlr_output, config_head->state.transform);
wlr_output_set_scale(wlr_output, config_head->state.scale);