aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Lindgren <john@jlindgren.net>2021-11-29 08:12:45 -0500
committerJohn Lindgren <21949-jlindgren90@users.noreply.gitlab.freedesktop.org>2021-11-29 13:14:31 +0000
commitbff5b2c5597b30b90b201825b6c1c6537bb06d84 (patch)
treed413c72a567250b58f62e33707e1b28ac6639ce7
parent0fb479ca611b31be20e7adc44ff14491ffcadf11 (diff)
Insert new outputs at the end of the list
This prevents auto-configuring a new output from changing the position of existing outputs. (v2: simplify insert-at-end logic)
-rw-r--r--types/wlr_output_layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c
index 782f5b71..eb672f06 100644
--- a/types/wlr_output_layout.c
+++ b/types/wlr_output_layout.c
@@ -185,7 +185,12 @@ static struct wlr_output_layout_output *output_layout_output_create(
l_output->state->layout = layout;
l_output->output = output;
wl_signal_init(&l_output->events.destroy);
- wl_list_insert(&layout->outputs, &l_output->link);
+
+ /*
+ * Insert at the end of the list so that auto-configuring the
+ * new output doesn't change the layout of other outputs
+ */
+ wl_list_insert(layout->outputs.prev, &l_output->link);
wl_signal_add(&output->events.mode, &l_output->state->mode);
l_output->state->mode.notify = handle_output_mode;