aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-23 08:38:15 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-23 08:39:11 +1000
commitcb66bbea42adeabd7bd87132a66589e14a46940f (patch)
tree43f409e1619b2deded320f0af7064e73e3969d30 /sway/ipc-server.c
parentMerge pull request #2677 from ggreer/pretty-fonts (diff)
downloadsway-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/ipc-server.c')
-rw-r--r--sway/ipc-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 8ae265f6..99959c97 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -580,7 +580,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
580 switch (client->current_command) { 580 switch (client->current_command) {
581 case IPC_COMMAND: 581 case IPC_COMMAND:
582 { 582 {
583 struct cmd_results *results = execute_command(buf, NULL); 583 struct cmd_results *results = execute_command(buf, NULL, NULL);
584 transaction_commit_dirty(); 584 transaction_commit_dirty();
585 char *json = cmd_results_to_json(results); 585 char *json = cmd_results_to_json(results);
586 int length = strlen(json); 586 int length = strlen(json);