Skip to content

Commit adb8669

Browse files
authored
Expose Winit's with_skip_taskbar on window creation (#12450)
# Objective Resolves #12431. ## Solution Added a `skip_taskbar` field to the `Window` struct (defaults to `false`). Used in `create_windows` if the target OS is Windows.
1 parent 2c95391 commit adb8669

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

crates/bevy_window/src/window.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,17 @@ pub struct Window {
259259
///
260260
/// - **Android / Wayland / Web:** Unsupported.
261261
pub visible: bool,
262+
/// Sets whether the window should be shown in the taskbar.
263+
///
264+
/// If `true`, the window will not appear in the taskbar.
265+
/// If `false`, the window will appear in the taskbar.
266+
///
267+
/// Note that this will only take effect on window creation.
268+
///
269+
/// ## Platform-specific
270+
///
271+
/// - Only supported on Windows.
272+
pub skip_taskbar: bool,
262273
}
263274

264275
impl Default for Window {
@@ -287,6 +298,7 @@ impl Default for Window {
287298
canvas: None,
288299
window_theme: None,
289300
visible: true,
301+
skip_taskbar: false,
290302
}
291303
}
292304
}

crates/bevy_winit/src/winit_windows.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ impl WinitWindows {
104104
.with_transparent(window.transparent)
105105
.with_visible(window.visible);
106106

107+
#[cfg(target_os = "windows")]
108+
{
109+
use winit::platform::windows::WindowBuilderExtWindows;
110+
winit_window_builder = winit_window_builder.with_skip_taskbar(window.skip_taskbar)
111+
}
112+
107113
#[cfg(any(
108114
target_os = "linux",
109115
target_os = "dragonfly",

0 commit comments

Comments
 (0)