diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index c51425c93..6efecf7cd 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -279,7 +279,7 @@ void container_insert_child(struct sway_container *parent, struct sway_container *child, int i); void container_add_sibling(struct sway_container *parent, - struct sway_container *child, int offset); + struct sway_container *child); void container_detach(struct sway_container *child); diff --git a/sway/commands/move.c b/sway/commands/move.c index 1b2e830c6..c20988187 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -233,7 +233,7 @@ static void container_move_to_container(struct sway_container *container, container->saved_width = container->saved_height = 0; if (destination->view) { - container_add_sibling(destination, container, 1); + container_add_sibling(destination, container); } else { container_add_child(destination, container); } diff --git a/sway/tree/container.c b/sway/tree/container.c index 0cb8d0a51..70b988f2a 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1079,13 +1079,13 @@ void container_insert_child(struct sway_container *parent, } void container_add_sibling(struct sway_container *fixed, - struct sway_container *active, int offset) { + struct sway_container *active) { if (active->workspace) { container_detach(active); } list_t *siblings = container_get_siblings(fixed); int index = list_find(siblings, fixed); - list_insert(siblings, index + offset, active); + list_insert(siblings, index + 1, active); active->parent = fixed->parent; active->workspace = fixed->workspace; container_for_each_child(active, set_workspace, NULL); @@ -1136,7 +1136,7 @@ void container_detach(struct sway_container *child) { void container_replace(struct sway_container *container, struct sway_container *replacement) { - container_add_sibling(container, replacement, 1); + container_add_sibling(container, replacement); container_detach(container); } diff --git a/sway/tree/view.c b/sway/tree/view.c index ff63df2d9..1b8d57385 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -515,7 +515,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { view->container = container_create(view); if (target_sibling) { - container_add_sibling(target_sibling, view->container, 1); + container_add_sibling(target_sibling, view->container); } else { workspace_add_tiling(ws, view->container); }