-
Notifications
You must be signed in to change notification settings - Fork 422
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
Bring back borderless mode for macOS and Linux #6264
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f3dfc4a
Bring back borderless mode for macOS and Linux
Susko3 4aea23f
Merge branch 'master' into bring-back-borderless
Susko3 623eef7
Fix merge fail
Susko3 63b05d4
Don't store windowed size when in fullscreen
Susko3 282f21a
Revert "Don't store windowed size when in fullscreen"
Susko3 ff2ee9d
Don't store windowed size to config from event watch
Susko3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding #6264 (comment), it appears that once the window is in borderless mode, it does not have the
SDL_WINDOW_FULLSCREEN
flag set:Therefore, the
WindowState
is kept at normal even after the window has switched to borderless, andsizeWindowed
becomes corrupted as a result, causing the window to become maximised when returning from borderless.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frenzibyte could you re-test this?
It's possible that this is because the window has not yet entered the fullscreen borderless mode due to animations still happening. Are the SDL window flags correct after the
SDL_EVENT_WINDOW_ENTER_FULLSCREEN
event arrives?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce again, and the statement above seems correct. The following path is triggered before the
SDL_EVENT_WINDOW_ENTER_FULLSCREEN
event, causing the size bindable to incorrectly store the borderless size:osu-framework/osu.Framework/Platform/SDL3/SDL3Window.cs
Lines 316 to 321 in 316bbce
I recall there was something about
SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED
being more reliable thanSDL_EVENT_WINDOW_RESIZED
to get the window size while the window is in its final state, I'm not sure how correct that is right now.All I can confirm is that
SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED
gets called afterSDL_EVENT_WINDOW_ENTER_FULLSCREEN
, and we have only been handlingSDL_EVENT_WINDOW_RESIZED
so the game doesn't look weird when resizing it. Perhaps we can just not store the window size in the "resized" event.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is triggered, what is the value of
SDL_GetWindowFlags(SDLWindowHandle)
? Framework has cached a stale state, but what does SDL say?Also please still check this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does have
SDL_WINDOW_FULLSCREEN
when checking the flags atSDL_EVENT_WINDOW_RESIZED
, whileWindowState
is indeed stale.The next event triggered after resize is
SDL_EVENT_WINDOW_ENTER_FULLSCREEN
, which is what updates theWindowState
toFullscreenBorderless
because of callingupdateAndFetchWindowSpecifics()
I suppose, and yes the SDL window flags remains correct thereafter.