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: diff --git a/wayland.c b/wayland.c index 7ab1ef2f..816ef1b6 100644 --- a/wayland.c +++ b/wayland.c @@ -804,8 +804,6 @@ wayl_win_init(struct wayland *wayl) wl_subsurface_set_desync(win->search_sub_surface); wl_surface_commit(win->surface); - wl_display_roundtrip(wayl->display); - return win; out: