aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-30 22:23:27 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-05 18:01:43 +1000
commit06d969382988e49c7308b43dd3740c8f363cb71f (patch)
treeaf4d73785507709cae174f7a1dd8d40c723400a3
parentFix crash when focus hits edge of root (diff)
downloadsway-06d969382988e49c7308b43dd3740c8f363cb71f.tar.gz
sway-06d969382988e49c7308b43dd3740c8f363cb71f.tar.zst
sway-06d969382988e49c7308b43dd3740c8f363cb71f.zip
Remove offset argument to container_add_sibling
I added this thinking that it might come in useful. Turns out it didn't.
-rw-r--r--include/sway/tree/container.h2
-rw-r--r--sway/commands/move.c2
-rw-r--r--sway/tree/container.c6
-rw-r--r--sway/tree/view.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index c51425c9..6efecf7c 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,
279 struct sway_container *child, int i); 279 struct sway_container *child, int i);
280 280
281void container_add_sibling(struct sway_container *parent, 281void container_add_sibling(struct sway_container *parent,
282 struct sway_container *child, int offset); 282 struct sway_container *child);
283 283
284void container_detach(struct sway_container *child); 284void container_detach(struct sway_container *child);
285 285
diff --git a/sway/commands/move.c b/sway/commands/move.c
index 1b2e830c..c2098818 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,
233 container->saved_width = container->saved_height = 0; 233 container->saved_width = container->saved_height = 0;
234 234
235 if (destination->view) { 235 if (destination->view) {
236 container_add_sibling(destination, container, 1); 236 container_add_sibling(destination, container);
237 } else { 237 } else {
238 container_add_child(destination, container); 238 container_add_child(destination, container);
239 } 239 }
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 0cb8d0a5..70b988f2 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1079,13 +1079,13 @@ void container_insert_child(struct sway_container *parent,
1079} 1079}
1080 1080
1081void container_add_sibling(struct sway_container *fixed, 1081void container_add_sibling(struct sway_container *fixed,
1082 struct sway_container *active, int offset) { 1082 struct sway_container *active) {
1083 if (active->workspace) { 1083 if (active->workspace) {
1084 container_detach(active); 1084 container_detach(active);
1085 } 1085 }
1086 list_t *siblings = container_get_siblings(fixed); 1086 list_t *siblings = container_get_siblings(fixed);
1087 int index = list_find(siblings, fixed); 1087 int index = list_find(siblings, fixed);
1088 list_insert(siblings, index + offset, active); 1088 list_insert(siblings, index + 1, active);
1089 active->parent = fixed->parent; 1089 active->parent = fixed->parent;
1090 active->workspace = fixed->workspace; 1090 active->workspace = fixed->workspace;
1091 container_for_each_child(active, set_workspace, NULL); 1091 container_for_each_child(active, set_workspace, NULL);
@@ -1136,7 +1136,7 @@ void container_detach(struct sway_container *child) {
1136 1136
1137void container_replace(struct sway_container *container, 1137void container_replace(struct sway_container *container,
1138 struct sway_container *replacement) { 1138 struct sway_container *replacement) {
1139 container_add_sibling(container, replacement, 1); 1139 container_add_sibling(container, replacement);
1140 container_detach(container); 1140 container_detach(container);
1141} 1141}
1142 1142
diff --git a/sway/tree/view.c b/sway/tree/view.c
index ff63df2d..1b8d5738 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) {
515 515
516 view->container = container_create(view); 516 view->container = container_create(view);
517 if (target_sibling) { 517 if (target_sibling) {
518 container_add_sibling(target_sibling, view->container, 1); 518 container_add_sibling(target_sibling, view->container);
519 } else { 519 } else {
520 workspace_add_tiling(ws, view->container); 520 workspace_add_tiling(ws, view->container);
521 } 521 }