aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-25 12:09:42 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-25 12:09:42 +1000
commitf4bc25bcc6c822e264938447940b7d75fa84319b (patch)
treeb04befcfad9b7c679b1dec388d168901fc5daf86 /sway/tree/container.c
parentMerge pull request #2499 from RyanDwyer/refactor-destroy-functions (diff)
downloadsway-f4bc25bcc6c822e264938447940b7d75fa84319b.tar.gz
sway-f4bc25bcc6c822e264938447940b7d75fa84319b.tar.zst
sway-f4bc25bcc6c822e264938447940b7d75fa84319b.zip
Relocate container_move, container_move_to and container_get_in_direction
* container_move is only called from the move command * container_move_to was called from both the move command and the sticky command, but the sticky command can easily not call it * container_get_in_direction is only called from the focus command Moving these functions to their respective commands gives better separation of code and removes bloat from layout.c. These functions will need to be refactored to take advantage of type safety, so separating them will make this easier to refactor. The following static functions have also been moved: * is_parellel * invert_movement * move_offs * container_limit * workspace_rejigger * move_out_of_tabs_stacks * get_swayc_in_output_direction They were all used by the move functions, except for the last one which is used by focus. Other changes: * index_child has been renamed to container_sibling_index, moved to container.c and made public * sway_output_from_wlr has been renamed to output_from_wlr_output, moved to output.c and made public * container_handle_fullscreen_reparent has been made public * sway_dir_to_wlr has been made public No changes have been made to any of the moved functions, other than updating calls to functions that have been renamed.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 6da6212c..5721c35c 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1123,3 +1123,8 @@ void container_discover_outputs(struct sway_container *con) {
1123 } 1123 }
1124 } 1124 }
1125} 1125}
1126
1127int container_sibling_index(const struct sway_container *child) {
1128 return list_find(child->parent->children, child);
1129}
1130