mirror of
https://github.com/swaywm/sway.git
synced 2025-01-16 08:05:58 +01:00
Merge pull request #2671 from emersion/output-execute-no-focus
Fix segfault when executing command without focus
This commit is contained in:
commit
fa4308c5ab
1 changed files with 9 additions and 4 deletions
|
@ -216,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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue