Add bevy_window::Window options for MacOS#15820
Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom Oct 11, 2024
Merged
Add bevy_window::Window options for MacOS#15820alice-i-cecile merged 2 commits intobevyengine:mainfrom
bevy_window::Window options for MacOS#15820alice-i-cecile merged 2 commits intobevyengine:mainfrom
Conversation
MacOS window titlebar settings fixes Remove borderless game option Clean up and add docs
oxkitsune
approved these changes
Oct 10, 2024
oxkitsune
left a comment
There was a problem hiding this comment.
very cool to see this exposed. i tried hacking around this and it wasn't pretty
mnmaita
reviewed
Oct 10, 2024
MrGVSV
reviewed
Oct 10, 2024
clarfonthey
approved these changes
Oct 11, 2024
Contributor
clarfonthey
left a comment
There was a problem hiding this comment.
Seems reasonable. Unfortunate some of these aren't better unified, since they could definitely apply to more than just MacOS, but that's more of a limitation of winit than bevy.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
MacOS has some nice options for controlling the window and titlebar to make the content appear much more "immersively" in the window. This PR exposes options for controlling this.
Solution
Adds new fields to
Windowto control these, with doc comments to explain what they do and that they're MacOS only.Testing
Tested on a MacOS machine (not my own, I don't have one). That's where the below screenshots were taken.
Showcase
On MacOS, you now have more options for configuring the window titlebar. You can, for example, make the title bar transparent and only show the window controls. This provides a more "immersive" experience for your rendered content.
Before, only this was possible:

Now, you can create windows like this:

This uses the following
bevy_window::Windowsettings:Migration Guide
bevy_window::Windownow has extra fields for configuring MacOS window settings:Using
Window::defaultkeeps the same behaviour as before.