Enable borderless_game for winit on macos#22853
Enable borderless_game for winit on macos#22853alice-i-cecile merged 1 commit intobevyengine:mainfrom
Conversation
dock/menu bar on macOS Fixes bevyengine#14783 Winit 0.30 added a window attribute that hides the dock and menu bar when using on macOS. This exposes that option as a field on Bevy's component, defaulting to since this is the expected behavior for games.
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
|
From the screenshots it looks like the menu bar is still taking up space, just with the icons hidden. Is that the case? |
|
That is the menu bar and notch area. To my knowledge all games have that blacked out as they don't want to stretch over that area (which would make the notch visible and also change the aspect ratio from 16:10 to something like 15.4:10) |
kfc35
left a comment
There was a problem hiding this comment.
Tested this on Sequoia and it works as expected.
Before: after initializing into borderless full screen mode, the menu bar becomes visible if you move the cursor over it
After: after initializing into borderless full screen mode, the menu bar stays invisible even if you move the cursor over it
Problem
Borderless Fullscreen on macOS does not hide the menu bar.
Fixes: #14783
Solution
winit 0.30 added a window attribute that hides the dock and menu bar when using on macOS. This exposes that option as a field on Bevy's component, defaulting to true since this is the expected behavior in games.
Testing
Tested by setting
Launch the bevy app, and you should see that the menu bar is hidden.
Showcase
Before:

After:

Known Issues
rust-windowing/winit#4477 - when switching spaces (e.g. using mission control), the menu bar regains visibility -- fixed by rust-windowing/winit#4482