From de0d349e68c2c2419cfcbb131c4ef17fc98a7a0e Mon Sep 17 00:00:00 2001 From: Gabriel Jacobo Date: Sat, 10 May 2014 16:50:05 -0300 Subject: [PATCH] Fixes #2512, handle configuration change messages sent by Wayland. Patch by Bryan Cain. --- src/video/wayland/SDL_waylandwindow.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index c040ca97c..57bc339ae 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -41,6 +41,19 @@ static void handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t edges, int32_t width, int32_t height) { + SDL_WindowData *wind = (SDL_WindowData *)data; + SDL_Window *window = wind->sdlwindow; + struct wl_region *region; + + window->w = width; + window->h = height; + WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0); + + region = wl_compositor_create_region(wind->waylandData->compositor); + wl_region_add(region, 0, 0, window->w, window->h); + wl_surface_set_opaque_region(wind->surface, region); + wl_region_destroy(region); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h); } static void