Skip to content

Commit

Permalink
Expose Winit's with_skip_taskbar on window creation (#12450)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
chompaa authored Mar 18, 2024
1 parent 2c95391 commit adb8669
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/bevy_window/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,17 @@ pub struct Window {
///
/// - **Android / Wayland / Web:** Unsupported.
pub visible: bool,
/// Sets whether the window should be shown in the taskbar.
///
/// If `true`, the window will not appear in the taskbar.
/// If `false`, the window will appear in the taskbar.
///
/// Note that this will only take effect on window creation.
///
/// ## Platform-specific
///
/// - Only supported on Windows.
pub skip_taskbar: bool,
}

impl Default for Window {
Expand Down Expand Up @@ -287,6 +298,7 @@ impl Default for Window {
canvas: None,
window_theme: None,
visible: true,
skip_taskbar: false,
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ impl WinitWindows {
.with_transparent(window.transparent)
.with_visible(window.visible);

#[cfg(target_os = "windows")]
{
use winit::platform::windows::WindowBuilderExtWindows;
winit_window_builder = winit_window_builder.with_skip_taskbar(window.skip_taskbar)
}

#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
Expand Down

0 comments on commit adb8669

Please sign in to comment.