src/video/wayland/SDL_waylandwindow.c
changeset 11944 295cf9910d75
parent 11848 2f157c1ca383
child 12033 bc702c5a7c3a
     1.1 --- a/src/video/wayland/SDL_waylandwindow.c	Sun Apr 15 09:37:51 2018 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandwindow.c	Sun Apr 15 17:42:09 2018 -0400
     1.3 @@ -113,6 +113,9 @@
     1.4      SDL_WindowData *wind = (SDL_WindowData *)data;
     1.5      SDL_Window *window = wind->sdlwindow;
     1.6      struct wl_region *region;
     1.7 +
     1.8 +    wind->shell_surface.zxdg.initial_configure_seen = SDL_TRUE;
     1.9 +
    1.10      WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
    1.11  
    1.12      region = wl_compositor_create_region(wind->waylandData->compositor);
    1.13 @@ -477,6 +480,17 @@
    1.14      wl_surface_commit(data->surface);
    1.15      WAYLAND_wl_display_flush(c->display);
    1.16  
    1.17 +    /* we have to wait until the surface gets a "configure" event, or
    1.18 +       use of this surface will fail. This is a new rule for xdg_shell. */
    1.19 +    if (c->shell.zxdg) {
    1.20 +        if (data->shell_surface.zxdg.surface) {
    1.21 +            while (!data->shell_surface.zxdg.initial_configure_seen) {
    1.22 +                WAYLAND_wl_display_flush(c->display);
    1.23 +                WAYLAND_wl_display_dispatch(c->display);
    1.24 +            }
    1.25 +        }
    1.26 +    }
    1.27 +
    1.28      return 0;
    1.29  }
    1.30