Navigation Menu

Skip to content

Commit

Permalink
Wayland: Resize windows with 0x0 requested size to screen size
Browse files Browse the repository at this point in the history
This makes it in line with other platforms, where SDL_CreateWindow() with
width=0, height=0 and SDL_WINDOW_FULLSCREEN opens a fullscreen window.
  • Loading branch information
thp committed Apr 5, 2014
1 parent 5a6f4d4 commit 929fd90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/video/wayland/SDL_waylandwindow.c
Expand Up @@ -164,6 +164,18 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window)
c->surface_extension, data->surface);
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */

/**
* If the user specified 0x0 as the size (turned to 1x1 by SDL_CreateWindow
* in SDL_video.c), we want to make the window fill the whole screen
**/
if (window->w == 1) {
window->w = c->screen_allocation.width;
}
if (window->h == 1) {
window->h = c->screen_allocation.height;
}

data->egl_window = WAYLAND_wl_egl_window_create(data->surface,
window->w, window->h);

Expand Down

0 comments on commit 929fd90

Please sign in to comment.