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 5489

Summary: [KMSDRM] Non-FULLSCREEN windows incorrecty use videomode changing to look fullscreen. Fix included.
Product: SDL Reporter: Manuel Alfayate Corchete <redwindwanderer>
Component: videoAssignee: Manuel Alfayate Corchete <redwindwanderer>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.15   
Hardware: All   
OS: Linux   
Attachments: Disable the normal window hack and correct cursor position.

Description Manuel Alfayate Corchete 2021-01-21 02:32:19 UTC
Created attachment 4682 [details]
Disable the normal window hack and correct cursor position.

Hi,

Until now I was "hacking" the normal, non-FULLSCREEN window creation so any window would fill the whole screen area while keeping it's aspect ratio.
That's just plain wrong as it breaks the API and compromises future multiple display support.

Included patch disables the "hack", so:

-normal windows look like windows, filling the corresponding area of the screen.
-FULLSCREEN windows cause a display mode change if necessary.
-FULLSCREEN_DESKTOP windows will use the "desktop resolution" as expected.

Also, not forcing normal windows to fill the screen height, the DRM cursor coordinates need to be converted, because DRM cursor Y coordinates start at the top of the screen. This patch also does that, and accesses the cursor through it's focus window, since that's the correct way in SDL design.

Please review and I will push, thanks!
Comment 1 Sam Lantinga 2021-01-23 17:26:18 UTC
Looks good.
Comment 2 Manuel Alfayate Corchete 2021-01-23 21:48:18 UTC
Great. Merged, closing this. Thanks!