window.c: Create xdg_surface up front

Fixes initial fullscreen for calibrator.

https://bugs.freedesktop.org/show_bug.cgi?id=76970
dev
Kristian Høgsberg 11 years ago
parent 9cd661e746
commit cdbbae2cac
  1. 5
      clients/terminal.c
  2. 25
      clients/window.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;

@ -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 *

Loading…
Cancel
Save