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 3063

Summary: [PATCH] Wayland: SDL resizes EGL surface to 0x0.
Product: SDL Reporter: x414e54
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: Other   
Attachments: Empty Resize Events Patch.
Empty Resize Events Patch New.

Description x414e54 2015-07-15 11:01:56 UTC
Created attachment 2219 [details]
Empty Resize Events Patch.

Wayland will sometimes send empty resize events (0 width and 0 height) to the client. I have not worked out the exact conditions a client would receive these but I can assume it might be if the window is offscreen or not mapped yet.

This causes issues with some SDL clients as they receive the 0x0 event and unexpected resize event or might not request to resize back to the correct size.

As per the wl_shell Wayland spec configure events are only a suggestion and the client is free to ignore or pick a different size (this is how min/max and fixed aspect ratio is supped to be implemented).


A patch is attached but is just the first iteration and I will fix any issues such as checking for FULLSCREEN/MAXIMIZED or RESIZABLE flags unless someone else fixes this first.
Comment 1 x414e54 2015-07-16 08:58:07 UTC
Created attachment 2220 [details]
Empty Resize Events Patch New.

I have update to take into account non resizable and fullscreen windows. Also adding in maximize/restore and title functions for Wayland.
Comment 2 Sam Lantinga 2016-10-08 01:11:40 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/786e10ab72d8