diff --git a/clients/terminal.c b/clients/terminal.c index 61ea9ae6..beec877f 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -2963,8 +2963,9 @@ terminal_run(struct terminal *terminal, const char *path) display_watch_fd(terminal->display, terminal->master, EPOLLIN | EPOLLHUP, &terminal->io_task); - window_set_fullscreen(terminal->window, option_fullscreen); - if (!window_is_fullscreen(terminal->window)) + if (option_fullscreen) + window_set_fullscreen(terminal->window, 1); + else terminal_resize(terminal, 80, 24); return 0; diff --git a/clients/window.c b/clients/window.c index c510f506..e770a040 100644 --- a/clients/window.c +++ b/clients/window.c @@ -3933,15 +3933,7 @@ window_flush(struct window *window) struct surface *surface; if (!window->custom) { - if (!window->xdg_popup && !window->xdg_surface) { - window->xdg_surface = xdg_shell_get_xdg_surface(window->display->xdg_shell, - window->main_surface->surface); - fail_on_null(window->xdg_surface); - - xdg_surface_set_user_data(window->xdg_surface, window); - xdg_surface_add_listener(window->xdg_surface, - &xdg_surface_listener, window); - + if (window->xdg_surface) { window_sync_transient_for(window); window_sync_margin(window); } @@ -4388,7 +4380,20 @@ window_create_internal(struct display *display, int custom) struct window * window_create(struct display *display) { - return window_create_internal(display, 0); + struct window *window; + + window = window_create_internal(display, 0); + + window->xdg_surface = + xdg_shell_get_xdg_surface(window->display->xdg_shell, + window->main_surface->surface); + fail_on_null(window->xdg_surface); + + xdg_surface_set_user_data(window->xdg_surface, window); + xdg_surface_add_listener(window->xdg_surface, + &xdg_surface_listener, window); + + return window; } struct window *