window.c: Create xdg_surface up front
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 7 Apr 2014 18:28:05 +0000 (11:28 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 7 Apr 2014 18:28:05 +0000 (11:28 -0700)
Fixes initial fullscreen for calibrator.

https://bugs.freedesktop.org/show_bug.cgi?id=76970

clients/terminal.c
clients/window.c

index 61ea9ae..beec877 100644 (file)
@@ -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;
index c510f50..e770a04 100644 (file)
@@ -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 *