pgo: initialize a dummy wayland backend

* Empty seat list
* Empty monitor list
* Add dummy terminal instance to terminal list
This commit is contained in:
Daniel Eklöf 2020-11-19 19:11:58 +01:00
parent 96db338262
commit 4cd1d35c1e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -137,7 +137,14 @@ main(int argc, const char *const *argv)
rows[i]->cells = calloc(col_count, sizeof(rows[i]->cells[0])); rows[i]->cells = calloc(col_count, sizeof(rows[i]->cells[0]));
} }
struct wayland wayl = {
.seats = tll_init(),
.monitors = tll_init(),
.terms = tll_init(),
};
struct terminal term = { struct terminal term = {
.wl = &wayl,
.grid = &term.normal, .grid = &term.normal,
.normal = { .normal = {
.num_rows = grid_row_count, .num_rows = grid_row_count,
@ -164,6 +171,8 @@ main(int argc, const char *const *argv)
}, },
}; };
tll_push_back(wayl.terms, &term);
int ret = EXIT_FAILURE; int ret = EXIT_FAILURE;
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; i++) {
@ -205,6 +214,8 @@ main(int argc, const char *const *argv)
ret = EXIT_SUCCESS; ret = EXIT_SUCCESS;
out: out:
tll_free(wayl.terms);
for (int i = 0; i < grid_row_count; i++) { for (int i = 0; i < grid_row_count; i++) {
free(rows[i]->cells); free(rows[i]->cells);
free(rows[i]); free(rows[i]);