diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-23 08:38:15 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-23 08:39:11 +1000 |
commit | cb66bbea42adeabd7bd87132a66589e14a46940f (patch) | |
tree | 43f409e1619b2deded320f0af7064e73e3969d30 /sway/main.c | |
parent | Merge pull request #2677 from ggreer/pretty-fonts (diff) | |
download | sway-cb66bbea42adeabd7bd87132a66589e14a46940f.tar.gz sway-cb66bbea42adeabd7bd87132a66589e14a46940f.tar.zst sway-cb66bbea42adeabd7bd87132a66589e14a46940f.zip |
Allow running commands on containers without focusing them
This adds a `con` argument to `execute_command` which allows you to
specify the container to execute the command on. In most cases it leaves
it as `NULL` which makes it use the focused node. We only set it when
executing `for_window` criteria such as when a view maps. This means we
don't send unnecessary IPC focus events, and fixes a crash when the
criteria command is `move scratchpad` (because we can't give focus to a
hidden scratchpad container).
Each of the shell map handlers now check to see if the view has a
workspace. It won't have a workspace if criteria has moved it to the
scratchpad.
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/main.c b/sway/main.c index 3d7cd158..990f5f3a 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -429,7 +429,7 @@ int main(int argc, char **argv) { | |||
429 | wlr_log(WLR_DEBUG, "Running deferred commands"); | 429 | wlr_log(WLR_DEBUG, "Running deferred commands"); |
430 | while (config->cmd_queue->length) { | 430 | while (config->cmd_queue->length) { |
431 | char *line = config->cmd_queue->items[0]; | 431 | char *line = config->cmd_queue->items[0]; |
432 | struct cmd_results *res = execute_command(line, NULL); | 432 | struct cmd_results *res = execute_command(line, NULL, NULL); |
433 | if (res->status != CMD_SUCCESS) { | 433 | if (res->status != CMD_SUCCESS) { |
434 | wlr_log(WLR_ERROR, "Error on line '%s': %s", line, res->error); | 434 | wlr_log(WLR_ERROR, "Error on line '%s': %s", line, res->error); |
435 | } | 435 | } |