Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Winit's with_skip_taskbar on window creation #12450

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
chompaa marked this conversation as resolved.
Show resolved Hide resolved
///
/// 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)
chompaa marked this conversation as resolved.
Show resolved Hide resolved
}

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