aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-09-21 20:05:39 +1000
committerGitHub <noreply@github.com>2018-09-21 20:05:39 +1000
commit0798fadff2f2f74a7efd7c14c55737bac19de954 (patch)
tree86e1ab4983fec3586a8bbb0044216216e22cc1cb /sway/commands.c
parent4289343e17615509fba5fe389d855f2292ba09bc (diff)
parentfa4308c5abecaeef870aced574e9d05e24e62392 (diff)
Merge branch 'master' into render-output-segfault
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 41e1c653..07169f1e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -143,6 +143,7 @@ static struct cmd_handler config_handlers[] = {
/* Runtime-only commands. Keep alphabetized */
static struct cmd_handler command_handlers[] = {
{ "border", cmd_border },
+ { "create_output", cmd_create_output },
{ "exit", cmd_exit },
{ "floating", cmd_floating },
{ "fullscreen", cmd_fullscreen },
@@ -215,18 +216,23 @@ struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers,
static void set_config_node(struct sway_node *node) {
config->handler_context.node = node;
+ config->handler_context.container = NULL;
+ config->handler_context.workspace = NULL;
+
+ if (node == NULL) {
+ return;
+ }
+
switch (node->type) {
case N_CONTAINER:
config->handler_context.container = node->sway_container;
config->handler_context.workspace = node->sway_container->workspace;
break;
case N_WORKSPACE:
- config->handler_context.container = NULL;
config->handler_context.workspace = node->sway_workspace;
break;
- default:
- config->handler_context.container = NULL;
- config->handler_context.workspace = NULL;
+ case N_ROOT:
+ case N_OUTPUT:
break;
}
}