diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 14 |
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[] = { | |||
143 | /* Runtime-only commands. Keep alphabetized */ | 143 | /* Runtime-only commands. Keep alphabetized */ |
144 | static struct cmd_handler command_handlers[] = { | 144 | static struct cmd_handler command_handlers[] = { |
145 | { "border", cmd_border }, | 145 | { "border", cmd_border }, |
146 | { "create_output", cmd_create_output }, | ||
146 | { "exit", cmd_exit }, | 147 | { "exit", cmd_exit }, |
147 | { "floating", cmd_floating }, | 148 | { "floating", cmd_floating }, |
148 | { "fullscreen", cmd_fullscreen }, | 149 | { "fullscreen", cmd_fullscreen }, |
@@ -215,18 +216,23 @@ struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers, | |||
215 | 216 | ||
216 | static void set_config_node(struct sway_node *node) { | 217 | static void set_config_node(struct sway_node *node) { |
217 | config->handler_context.node = node; | 218 | config->handler_context.node = node; |
219 | config->handler_context.container = NULL; | ||
220 | config->handler_context.workspace = NULL; | ||
221 | |||
222 | if (node == NULL) { | ||
223 | return; | ||
224 | } | ||
225 | |||
218 | switch (node->type) { | 226 | switch (node->type) { |
219 | case N_CONTAINER: | 227 | case N_CONTAINER: |
220 | config->handler_context.container = node->sway_container; | 228 | config->handler_context.container = node->sway_container; |
221 | config->handler_context.workspace = node->sway_container->workspace; | 229 | config->handler_context.workspace = node->sway_container->workspace; |
222 | break; | 230 | break; |
223 | case N_WORKSPACE: | 231 | case N_WORKSPACE: |
224 | config->handler_context.container = NULL; | ||
225 | config->handler_context.workspace = node->sway_workspace; | 232 | config->handler_context.workspace = node->sway_workspace; |
226 | break; | 233 | break; |
227 | default: | 234 | case N_ROOT: |
228 | config->handler_context.container = NULL; | 235 | case N_OUTPUT: |
229 | config->handler_context.workspace = NULL; | ||
230 | break; | 236 | break; |
231 | } | 237 | } |
232 | } | 238 | } |