mirror of
https://github.com/swaywm/sway.git
synced 2024-11-10 20:44:01 +01:00
Added in better exit handling
This commit is contained in:
parent
c94c41d1db
commit
dfaf3a059f
@ -12,6 +12,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
#include "container.h"
|
||||||
|
|
||||||
struct modifier_key {
|
struct modifier_key {
|
||||||
char *name;
|
char *name;
|
||||||
@ -152,11 +153,18 @@ static bool cmd_exec(struct sway_config *config, int argc, char **argv) {
|
|||||||
return cmd_exec_always(config, argc, argv);
|
return cmd_exec_always(config, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void kill_views(swayc_t *container, void *data) {
|
||||||
|
if (container->type == C_VIEW) {
|
||||||
|
wlc_view_close(container->handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool cmd_exit(struct sway_config *config, int argc, char **argv) {
|
static bool cmd_exit(struct sway_config *config, int argc, char **argv) {
|
||||||
if (!checkarg(argc, "exit", EXPECTED_EQUAL_TO, 0)) {
|
if (!checkarg(argc, "exit", EXPECTED_EQUAL_TO, 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// TODO: Some kind of clean up is probably in order
|
// Close all views
|
||||||
|
container_map(&root_container, kill_views, NULL);
|
||||||
exit(0);
|
exit(0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user