| Summary: | [PATCH] Wayland: Resize windows with 0x0 requested size to screen size | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Thomas Perl <m> |
| Component: | video | Assignee: | 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 | ||
Got it, thanks! https://hg.libsdl.org/SDL/rev/e33b5f7df761 |
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.