aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/kill.c17
-rw-r--r--sway/commands/layout.c3
-rw-r--r--sway/commands/move.c2
-rw-r--r--sway/commands/workspace.c6
4 files changed, 6 insertions, 22 deletions
diff --git a/sway/commands/kill.c b/sway/commands/kill.c
index 46d6e98e..f3fa52f1 100644
--- a/sway/commands/kill.c
+++ b/sway/commands/kill.c
@@ -10,22 +10,7 @@ struct cmd_results *cmd_kill(int argc, char **argv) {
struct sway_container *con =
config->handler_context.current_container;
- switch (con->type) {
- case C_ROOT:
- case C_OUTPUT:
- case C_WORKSPACE:
- case C_TYPES:
- return cmd_results_new(CMD_INVALID, NULL,
- "Can only kill views and containers with this command");
- break;
- case C_CONTAINER:
- con = container_destroy(con);
- arrange_windows(con, -1, -1);
- break;
- case C_VIEW:
- view_close(con->sway_view);
- break;
- }
+ container_close(con);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index ebab2a48..4c49a627 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -28,8 +28,7 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
if (strcasecmp(argv[0], "default") == 0) {
container_set_layout(parent, parent->prev_layout);
if (parent->layout == L_NONE) {
- struct sway_container *output = container_parent(parent, C_OUTPUT);
- container_set_layout(parent, container_get_default_layout(output));
+ container_set_layout(parent, container_get_default_layout(parent));
}
} else {
if (parent->layout != L_TABBED && parent->layout != L_STACKED) {
diff --git a/sway/commands/move.c b/sway/commands/move.c
index 644c622b..c954ab94 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -74,7 +74,7 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
ws = workspace_by_name(ws_name);
}
if (!ws) {
- ws = workspace_create(ws_name ? ws_name : num_name);
+ ws = workspace_create(NULL, ws_name ? ws_name : num_name);
}
free(ws_name);
struct sway_container *old_parent = current->parent;
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index aa4096f7..958b3222 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -61,7 +61,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
if (strcasecmp(argv[0], "number") == 0) {
if (!(ws = workspace_by_number(argv[1]))) {
char *name = join_args(argv + 1, argc - 1);
- ws = workspace_create(name);
+ ws = workspace_create(NULL, name);
free(name);
}
} else if (strcasecmp(argv[0], "next") == 0) {
@@ -80,12 +80,12 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
ws = old_workspace;
} else if (prev_workspace_name
&& !(ws = workspace_by_name(prev_workspace_name))) {
- ws = workspace_create(prev_workspace_name);
+ ws = workspace_create(NULL, prev_workspace_name);
}
} else {
char *name = join_args(argv, argc);
if (!(ws = workspace_by_name(name))) {
- ws = workspace_create(name);
+ ws = workspace_create(NULL, name);
}
free(name);
}