aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/kill.c')
-rw-r--r--sway/commands/kill.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sway/commands/kill.c b/sway/commands/kill.c
index 742e2b86..f3fa52f1 100644
--- a/sway/commands/kill.c
+++ b/sway/commands/kill.c
@@ -1,12 +1,16 @@
1#include <wlr/util/log.h>
2#include "log.h"
3#include "sway/input/input-manager.h"
4#include "sway/input/seat.h"
5#include "sway/tree/view.h"
6#include "sway/tree/container.h"
1#include "sway/commands.h" 7#include "sway/commands.h"
2#include "sway/container.h"
3#include "sway/focus.h"
4 8
5struct cmd_results *cmd_kill(int argc, char **argv) { 9struct cmd_results *cmd_kill(int argc, char **argv) {
6 if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file."); 10 struct sway_container *con =
7 if (!config->active) return cmd_results_new(CMD_FAILURE, "kill", "Can only be used when sway is running."); 11 config->handler_context.current_container;
12
13 container_close(con);
8 14
9 swayc_t *container = current_container;
10 close_views(container);
11 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 15 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
12} 16}