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 - [KMSDRM] Non-FULLSCREEN windows incorrecty use videomode changing to look fullscreen. Fix included.
Summary: [KMSDRM] Non-FULLSCREEN windows incorrecty use videomode changing to look ful...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.15
Hardware: All Linux
: P2 normal
Assignee: Manuel Alfayate Corchete
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-21 02:32 UTC by Manuel Alfayate Corchete
Modified: 2021-01-23 21:48 UTC (History)
0 users

See Also:


Attachments
Disable the normal window hack and correct cursor position. (8.90 KB, patch)
2021-01-21 02:32 UTC, Manuel Alfayate Corchete
Details | Diff

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