mirror of
https://github.com/bevyengine/bevy
synced 2024-11-24 21:53:07 +00:00
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.
This commit is contained in:
parent
2c953914bc
commit
adb866947b
2 changed files with 18 additions and 0 deletions
|
@ -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 {
|
||||
|
@ -287,6 +298,7 @@ impl Default for Window {
|
|||
canvas: None,
|
||||
window_theme: None,
|
||||
visible: true,
|
||||
skip_taskbar: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue