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 - [PATCH] Wayland: Resize windows with 0x0 requested size to screen size
Summary: [PATCH] Wayland: Resize windows with 0x0 requested size to screen size
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-07 08:34 UTC by Thomas Perl
Modified: 2014-04-18 03:53 UTC (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.23 KB, patch)
2014-04-07 08:34 UTC, Thomas Perl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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