Hi,
With the Wayland video driver, requesting a 0x0 window with SDL_WINDOW_FULLSCREEN will make the window fullscreen, but the EGL surface that?s being created has a size of 1x1. This patch fixes this by making the EGL surface the size of the screen if one or both of the sides are 1 (or 0; 0 gets turned into 1 by SDL_CreateWindow()).
It doesn?t check the flags, because for some reason, SDL_WINDOW_FULLSCREEN isn?t in the flags of the window in the Wayland create window function, even when it is passed to SDL_CreateWindow(). This means that the width/height will also be changed for a SDL_CreateWindow() call /without/ SDL_WINDOW_FULLSCREEN set, but that?s usually okay, because if you create a window of a certain size, you don?t pass in 0x0 as its size.
Patch against yesterday?s Hg default branch attached, successfully tested under QtWayland on Sailfish OS.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl2_wayland-fullscreen-size.patch
Type: application/octet-stream
Size: 1264 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20140406/998c03ab/attachment.obj
-------------- next part --------------
To test, simply build SDL2 with the patch applied, then create a window like this:
SDL_CreateWindow(??, SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 0, 0,
SDL_WINDOW_FULLSCREEN);
Without the patch, the EGL surface will have a size of 1x1, with the patch, the EGL surface will have the size of the screen, which is what also happens with most (all?) other platforms.
Thanks,
Thomas
PS: Bugzilla registration seems to be broken, I didn?t get a confirmation e-mail; otherwise I?d have posted this patch directly in Bugzilla.