wayland: track multiple terminals

The wayland 'term' member is gone and replaced by a list,
'terms'. This list contains all currently running terminal (windows).
This commit is contained in:
Daniel Eklöf 2019-10-30 20:02:06 +01:00
parent e084bf2b0f
commit 445bbe3469
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 26 additions and 15 deletions

12
main.c
View file

@ -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);