Wayland: Resize windows with 0x0 requested size to screen size
authorThomas Perl <m@thp.io>
Sat, 05 Apr 2014 17:19:34 +0200
changeset 8712e33b5f7df761
parent 8711 46f85bfe9303
child 8713 e3a80970cf0b
Wayland: Resize windows with 0x0 requested size to screen size

This makes it in line with other platforms, where SDL_CreateWindow() with
width=0, height=0 and SDL_WINDOW_FULLSCREEN opens a fullscreen window.
src/video/wayland/SDL_waylandwindow.c
     1.1 --- a/src/video/wayland/SDL_waylandwindow.c	Thu Apr 17 20:51:28 2014 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandwindow.c	Sat Apr 05 17:19:34 2014 +0200
     1.3 @@ -164,6 +164,18 @@
     1.4                  c->surface_extension, data->surface);
     1.5      }
     1.6  #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
     1.7 +
     1.8 +    /**
     1.9 +     * If the user specified 0x0 as the size (turned to 1x1 by SDL_CreateWindow
    1.10 +     * in SDL_video.c), we want to make the window fill the whole screen
    1.11 +     **/
    1.12 +    if (window->w == 1) {
    1.13 +        window->w = c->screen_allocation.width;
    1.14 +    }
    1.15 +    if (window->h == 1) {
    1.16 +        window->h = c->screen_allocation.height;
    1.17 +    }
    1.18 +
    1.19      data->egl_window = WAYLAND_wl_egl_window_create(data->surface,
    1.20                                              window->w, window->h);
    1.21