diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs index 98c9973e2f7ce..01e023793ca89 100644 --- a/crates/bevy_window/src/window.rs +++ b/crates/bevy_window/src/window.rs @@ -432,6 +432,18 @@ pub struct Window { /// /// [`WindowAttributesExtMacOS::with_titlebar_buttons_hidden`]: https://docs.rs/winit/latest/x86_64-apple-darwin/winit/platform/macos/trait.WindowAttributesExtMacOS.html#tymethod.with_titlebar_buttons_hidden pub titlebar_show_buttons: bool, + /// Hides the dock and menu bar when a borderless fullscreen window is active. + /// + /// Corresponds to [`WindowAttributesExtMacOS::with_borderless_game`]. + /// + /// Defaults to `true` as this is the expected behavior for games. + /// + /// # Platform-specific + /// + /// - Only used on macOS. + /// + /// [`WindowAttributesExtMacOS::with_borderless_game`]: https://docs.rs/winit/latest/x86_64-apple-darwin/winit/platform/macos/trait.WindowAttributesExtMacOS.html#tymethod.with_borderless_game + pub borderless_game: bool, /// Sets whether the Window prefers the home indicator hidden. /// /// Corresponds to [`WindowAttributesExtIOS::with_prefers_home_indicator_hidden`]. @@ -504,6 +516,7 @@ impl Default for Window { titlebar_transparent: false, titlebar_show_title: true, titlebar_show_buttons: true, + borderless_game: true, prefers_home_indicator_hidden: false, prefers_status_bar_hidden: false, preferred_screen_edges_deferring_system_gestures: Default::default(), diff --git a/crates/bevy_winit/src/winit_windows.rs b/crates/bevy_winit/src/winit_windows.rs index ea885efa90402..3afc49bac85cb 100644 --- a/crates/bevy_winit/src/winit_windows.rs +++ b/crates/bevy_winit/src/winit_windows.rs @@ -152,7 +152,8 @@ impl WinitWindows { .with_titlebar_hidden(!window.titlebar_shown) .with_titlebar_transparent(window.titlebar_transparent) .with_title_hidden(!window.titlebar_show_title) - .with_titlebar_buttons_hidden(!window.titlebar_show_buttons); + .with_titlebar_buttons_hidden(!window.titlebar_show_buttons) + .with_borderless_game(window.borderless_game); } #[cfg(target_os = "ios")]