From cdbbae2cac8b247511c37812253df65b7c69bf5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 7 Apr 2014 11:28:05 -0700 Subject: [PATCH] window.c: Create xdg_surface up front Fixes initial fullscreen for calibrator. https://bugs.freedesktop.org/show_bug.cgi?id=76970 --- clients/terminal.c | 5 +++-- clients/window.c | 25 +++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) 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 *