summaryrefslogtreecommitdiff
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorTony Crisci <[email protected]>2018-04-03 12:25:19 -0400
committerTony Crisci <[email protected]>2018-04-03 12:25:19 -0400
commitb4c5f79725142c78a398a22981392d645bc9d2e9 (patch)
treec6f836b1179c018c55b6dfead9cbca4e2fa97876 /sway/tree/workspace.c
parent7afbe9284ff1ca2eece6da1838061cad9ed655e0 (diff)
move view and workspace destructors to container.c
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 74330884..7d180009 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -208,45 +208,6 @@ struct sway_container *workspace_create(const char *name) {
return new_ws;
}
-struct sway_container *container_workspace_destroy(
- struct sway_container *workspace) {
- if (!sway_assert(workspace, "cannot destroy null workspace")) {
- return NULL;
- }
-
- // Do not destroy this if it's the last workspace on this output
- struct sway_container *output = container_parent(workspace, C_OUTPUT);
- if (output && output->children->length == 1) {
- return NULL;
- }
-
- struct sway_container *parent = workspace->parent;
- if (workspace->children->length == 0) {
- // destroy the WS if there are no children (TODO check for floating)
- wlr_log(L_DEBUG, "destroying workspace '%s'", workspace->name);
- ipc_event_workspace(workspace, NULL, "empty");
- } else {
- // Move children to a different workspace on this output
- struct sway_container *new_workspace = NULL;
- // TODO move floating
- for (int i = 0; i < output->children->length; i++) {
- if (output->children->items[i] != workspace) {
- new_workspace = output->children->items[i];
- break;
- }
- }
-
- wlr_log(L_DEBUG, "moving children to different workspace '%s' -> '%s'",
- workspace->name, new_workspace->name);
- for (int i = 0; i < workspace->children->length; i++) {
- container_move_to(workspace->children->items[i], new_workspace);
- }
- }
-
- container_destroy(workspace);
- return parent;
-}
-
/**
* Get the previous or next workspace on the specified output. Wraps around at
* the end and beginning. If next is false, the previous workspace is returned,