From 16c663ed49e3950388901f220066e4da69956dfb Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 18 Aug 2018 21:54:09 +1000 Subject: Rename container_sort_workspaces and container_wrap_children This commit renames container_sort_workspaces to output_sort_workspaces and moves it to output.c. This also renames container_wrap_children to workspace_wrap_children and moves it to workspace.c. This function is only called with workspaces. --- sway/tree/workspace.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sway/tree/workspace.c') diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index e7383de0..1c0e6515 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -75,7 +75,7 @@ struct sway_container *workspace_create(struct sway_container *output, workspace_output_add_priority(workspace, output); container_add_child(output, workspace); - container_sort_workspaces(output); + output_sort_workspaces(output); container_create_notify(workspace); return workspace; @@ -537,3 +537,15 @@ void workspace_detect_urgent(struct sway_container *workspace) { container_damage_whole(workspace); } } + +struct sway_container *workspace_wrap_children(struct sway_container *ws) { + struct sway_container *middle = container_create(C_CONTAINER); + middle->layout = ws->layout; + while (ws->children->length) { + struct sway_container *child = ws->children->items[0]; + container_remove_child(child); + container_add_child(middle, child); + } + container_add_child(ws, middle); + return middle; +} -- cgit v1.2.3