aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-03 10:16:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-03 10:16:06 +0000
commit913c684844ad41c8a4b803abd649a9460e3a57dd (patch)
treeb2627d7d7280c6bb05b860ebfe1e72fcb45ed031 /terminal.c
parentterm: spell 'initialize' correctly (diff)
term: term_init() calls wl_display_roundtrip()
Instead of having `wayl_win_init()` call `wl_display_roundtrip()` (which it itself doesn't need), call it from `term_init()`. This allows us to add ourselves (the new terminal instance) to the terminal list in the wayland backend, before triggering the wayland events caused by `wayl_win_init()`. This is turn allows the wayland backend to find/lookup the new terminal when those events occur..
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/terminal.c b/terminal.c
index 8a602925..c3697720 100644
--- a/terminal.c
+++ b/terminal.c
@@ -657,6 +657,12 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
if ((term->window = wayl_win_init(wayl)) == NULL)
goto err;
+ /* Let the Wayland backend know we exist */
+ tll_push_back(wayl->terms, term);
+
+ /* Roundtrip to ensure the wayland window have been configured */
+ wl_display_roundtrip(term->wl->display);
+
term_set_window_title(term, "foot");
/* Try to use user-configured window dimentions */
@@ -675,7 +681,6 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
height = max(height, term->cell_height);
render_resize(term, width, height);
- tll_push_back(wayl->terms, term);
return term;
err: