Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Mac/X11/Win32 fullscreen window placement #7286

Merged
merged 2 commits into from
Feb 11, 2023

Conversation

Kontrabant
Copy link
Contributor

@Kontrabant Kontrabant commented Feb 10, 2023

Fixes up the fullscreen placement mechanism so that macOS, Win32 and X11 (real Xorg and XWayland) place exclusive fullscreen window on the proper displays.

This ends up splitting the display retrieval functions into one that returns the explicit display for fullscreen windows over all else and another that works strictly on position for when a window is moved, as Macs and Windows need the former to correctly position exclusive fullscreen windows. A small X11 fix is also needed, as both real Xorg and XWayland need the window to actually be moved to the display where it's being made fullscreen for it to appear on the correct display.

@slouken
Copy link
Collaborator

slouken commented Feb 10, 2023

This might be relevant for Windows:
#7134 (comment)

@Kontrabant Kontrabant changed the title Fixes for Mac/X11 fullscreen window placement Fixes for Mac/X11/Win32 fullscreen window placement Feb 11, 2023
…indow was moved

 When an exclusive fullscreen display is specified, it overrides any positioning, including from driver specific functions. Allows for the proper placement of fullscreen windows on macOS and Windows when the floating window is on a display that differs from the one specified by the exclusive fullscreen mode.

 A specific position-only function has been split out for use when a window has been moved.
Set the window position when entering fullscreen as both real Xorg and XWayland need this in order for the window to be on the correct display.
@Kontrabant
Copy link
Contributor Author

Turns out the erratic behavior I was seeing on Windows was due to SDL defaulting to the d3d9 render backend as it seems that, at least on Nvidia drivers, using d3d9 with multiple displays behaves quite badly. With the d3d11/d3d12/opengl renderers, it works just fine. Maybe it's time to move the d3d9 driver down in priority if it causes issues on modern systems? XP has been EOL for almost a decade at this point and doesn't even show up on the Steam hardware surveys anymore. d3d11 would probably be a much more sane default for SDL3.

This pull is tested and good on all platforms then, and the video core change actually fixes window placement on Win32 as well. Still one issue when it comes to window sizing when moving fullscreen desktop windows between displays with different scale values on Win32, then the larger fullscreen move patch will be ready for review.

@Kontrabant Kontrabant merged commit 4a6f3cf into libsdl-org:main Feb 11, 2023
@Kontrabant Kontrabant deleted the video_fs_position branch February 16, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants