summaryrefslogtreecommitdiffstats
path: root/window-choose.c
diff options
context:
space:
mode:
authornicm <nicm>2016-10-16 17:55:14 +0000
committernicm <nicm>2016-10-16 17:55:14 +0000
commitddc4512d2e0eda6c705e002cb5dbf80719d709e1 (patch)
treecd9ff99f4b1ccb3e76ab99633d59772ae07c3092 /window-choose.c
parentbfe14b531267f3762a518f98b72a3148a134396a (diff)
Rewrite command queue handling. Each client still has a command queue,
but there is also now a global command queue. Instead of command queues being dispatched on demand from wherever the command happens to be added, they are now all dispatched from the top level server loop. Command queues may now also include callbacks as well as commands, and items may be inserted after the current command as well as at the end. This all makes command queues significantly more predictable and easier to use, and avoids the complex multiple nested command queues used by source-file, if-shell and friends. A mass rename of struct cmdq to a better name (cmdq_item probably) is coming.
Diffstat (limited to 'window-choose.c')
-rw-r--r--window-choose.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/window-choose.c b/window-choose.c
index 25dc77d1..b7720e8d 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -246,6 +246,7 @@ window_choose_data_run(struct window_choose_data *cdata)
{
struct cmd_list *cmdlist;
char *cause;
+ struct cmd_q *cmdq;
/*
* The command template will have already been replaced. But if it's
@@ -263,7 +264,8 @@ window_choose_data_run(struct window_choose_data *cdata)
return;
}
- cmdq_run(cdata->start_client->cmdq, cmdlist, NULL);
+ cmdq = cmdq_get_command(cmdlist, NULL, NULL, 0);
+ cmdq_append(cdata->start_client, cmdq);
cmd_list_free(cmdlist);
}