aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-10-30 19:02:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-10-30 19:02:06 +0000
commit445bbe3469b057c8b518f7c787527128f724cc1b (patch)
treececb41d9d6ddf589852f57cadd275bbbc433e40d /main.c
parentMerge branch 'term-init-cleanup' (diff)
wayland: track multiple terminals
The wayland 'term' member is gone and replaced by a list, 'terms'. This list contains all currently running terminal (windows).
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.c b/main.c
index b09b5e3b..ebc35a20 100644
--- a/main.c
+++ b/main.c
@@ -146,20 +146,22 @@ main(int argc, char *const *argv)
if ((term = term_init(&conf, fdm, wayl, argc, argv)) == NULL)
goto out;
- while (true) {
- wl_display_flush(term->wl->display); /* TODO: figure out how to get rid of this */
+ while (tll_length(wayl->terms) > 0) {
+ wl_display_flush(wayl->display); /* TODO: figure out how to get rid of this */
if (!fdm_poll(fdm))
break;
}
- if (term->quit)
- ret = EXIT_SUCCESS;
+ ret = tll_length(wayl->terms) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
out:
shm_fini();
- int child_ret = term_destroy(term);
+ int child_ret = EXIT_SUCCESS;
+ tll_foreach(wayl->terms, it)
+ child_ret = term_destroy(it->item);
+
wayl_destroy(wayl);
fdm_destroy(fdm);
config_free(conf);