diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-05-16 12:29:30 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-05-16 16:50:56 +0900 |
commit | 89ae1792b58a1a29afce7e00da06593187297459 (patch) | |
tree | 770f7f47574311c5ee91f8217defb4e6ba0a41a4 /sway/main.c | |
parent | swayidle: terminate if wl_display_dispatch failed (diff) | |
download | sway-89ae1792b58a1a29afce7e00da06593187297459.tar.gz sway-89ae1792b58a1a29afce7e00da06593187297459.tar.zst sway-89ae1792b58a1a29afce7e00da06593187297459.zip |
sway: run commands without waiting for Xwayland
Xwayland is lazy now, there is no need to wait at all
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sway/main.c b/sway/main.c index efb674b6..e03b8e3a 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <sys/prctl.h> | 16 | #include <sys/prctl.h> |
17 | #endif | 17 | #endif |
18 | #include <wlr/util/log.h> | 18 | #include <wlr/util/log.h> |
19 | #include "sway/commands.h" | ||
19 | #include "sway/config.h" | 20 | #include "sway/config.h" |
20 | #include "sway/debug.h" | 21 | #include "sway/debug.h" |
21 | #include "sway/server.h" | 22 | #include "sway/server.h" |
@@ -410,9 +411,18 @@ int main(int argc, char **argv) { | |||
410 | 411 | ||
411 | security_sanity_check(); | 412 | security_sanity_check(); |
412 | 413 | ||
413 | // TODO: wait for server to be ready | ||
414 | // TODO: consume config->cmd_queue | ||
415 | config->active = true; | 414 | config->active = true; |
415 | // Execute commands until there are none left | ||
416 | while (config->cmd_queue->length) { | ||
417 | char *line = config->cmd_queue->items[0]; | ||
418 | struct cmd_results *res = execute_command(line, NULL); | ||
419 | if (res->status != CMD_SUCCESS) { | ||
420 | wlr_log(L_ERROR, "Error on line '%s': %s", line, res->error); | ||
421 | } | ||
422 | free_cmd_results(res); | ||
423 | free(line); | ||
424 | list_del(config->cmd_queue, 0); | ||
425 | } | ||
416 | 426 | ||
417 | if (!terminate_request) { | 427 | if (!terminate_request) { |
418 | server_run(&server); | 428 | server_run(&server); |