We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2481

Summary: [PATCH] Wayland: Resize windows with 0x0 requested size to screen size
Product: SDL Reporter: Thomas Perl <m>
Component: videoAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: gabomdq
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Proposed patch

Description Thomas Perl 2014-04-07 08:34:14 UTC
Created attachment 1609 [details]
Proposed patch

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.
Comment 1 Sam Lantinga 2014-04-18 03:53:59 UTC
Got it, thanks!
https://hg.libsdl.org/SDL/rev/e33b5f7df761