mirror of
https://github.com/swaywm/sway.git
synced 2024-11-23 00:11:28 +00:00
Fix segfault when executing command without focus
This commit is contained in:
parent
a83773e5ca
commit
efc08ec888
|
@ -215,18 +215,23 @@ struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers,
|
||||||
|
|
||||||
static void set_config_node(struct sway_node *node) {
|
static void set_config_node(struct sway_node *node) {
|
||||||
config->handler_context.node = node;
|
config->handler_context.node = node;
|
||||||
|
config->handler_context.container = NULL;
|
||||||
|
config->handler_context.workspace = NULL;
|
||||||
|
|
||||||
|
if (node == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (node->type) {
|
switch (node->type) {
|
||||||
case N_CONTAINER:
|
case N_CONTAINER:
|
||||||
config->handler_context.container = node->sway_container;
|
config->handler_context.container = node->sway_container;
|
||||||
config->handler_context.workspace = node->sway_container->workspace;
|
config->handler_context.workspace = node->sway_container->workspace;
|
||||||
break;
|
break;
|
||||||
case N_WORKSPACE:
|
case N_WORKSPACE:
|
||||||
config->handler_context.container = NULL;
|
|
||||||
config->handler_context.workspace = node->sway_workspace;
|
config->handler_context.workspace = node->sway_workspace;
|
||||||
break;
|
break;
|
||||||
default:
|
case N_ROOT:
|
||||||
config->handler_context.container = NULL;
|
case N_OUTPUT:
|
||||||
config->handler_context.workspace = NULL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue