Fixes #2512, handle configuration change messages sent by Wayland. Patch by Bryan Cain.
authorGabriel Jacobo <gabomdq@gmail.com>
Sat, 10 May 2014 16:50:05 -0300
changeset 8766e5f584f77609
parent 8765 cdf0aad10fea
child 8767 8719af30db6b
Fixes #2512, handle configuration change messages sent by Wayland. Patch by Bryan Cain.
src/video/wayland/SDL_waylandwindow.c
     1.1 --- a/src/video/wayland/SDL_waylandwindow.c	Sat May 10 12:34:16 2014 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandwindow.c	Sat May 10 16:50:05 2014 -0300
     1.3 @@ -41,6 +41,19 @@
     1.4  handle_configure(void *data, struct wl_shell_surface *shell_surface,
     1.5                   uint32_t edges, int32_t width, int32_t height)
     1.6  {
     1.7 +    SDL_WindowData *wind = (SDL_WindowData *)data;
     1.8 +    SDL_Window *window = wind->sdlwindow;
     1.9 +    struct wl_region *region;
    1.10 +
    1.11 +    window->w = width;
    1.12 +    window->h = height;
    1.13 +    WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
    1.14 +
    1.15 +    region = wl_compositor_create_region(wind->waylandData->compositor);
    1.16 +    wl_region_add(region, 0, 0, window->w, window->h);
    1.17 +    wl_surface_set_opaque_region(wind->surface, region);
    1.18 +    wl_region_destroy(region);
    1.19 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
    1.20  }
    1.21  
    1.22  static void