diff options
author | mwenzkowski <29407878+mwenzkowski@users.noreply.github.com> | 2018-12-05 08:20:40 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-12-05 11:32:23 +0100 |
commit | cf6edaf26aa1461b89552727d2435d6fe9d0adf3 (patch) | |
tree | 4fc5994cb2df79fa0570f9224edb3c6ab2415051 /sway | |
parent | 6ccc836ebf282a1ffe5c19fb6ff2e2b55d2f21e6 (diff) | |
download | sway-cf6edaf26aa1461b89552727d2435d6fe9d0adf3.tar.xz |
Fix command list execution
Determine the container/workspace a command is run on, each time when a
command of the command list will be run.
Previously the container/workspace was determined only once at the
beginning of command list execution, which led to wrong behaviour
because commands wouldn't take into account when a previous command
changed the focused container.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sway/commands.c b/sway/commands.c index 1203f63a..d5cab655 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -232,15 +232,6 @@ list_t *execute_command(char *_exec, struct sway_seat *seat, } } - // This is the container or workspace which this command will run on. - // Ignored if the command string contains criteria. - struct sway_node *node; - if (con) { - node = &con->node; - } else { - node = seat_get_focus_inactive(seat, &root->node); - } - config->handler_context.seat = seat; head = exec; @@ -301,6 +292,9 @@ list_t *execute_command(char *_exec, struct sway_seat *seat, } if (!config->handler_context.using_criteria) { + // The container or workspace which this command will run on. + struct sway_node *node = con ? &con->node : + seat_get_focus_inactive(seat, &root->node); set_config_node(node); struct cmd_results *res = handler->handle(argc-1, argv+1); list_add(res_list, res); |