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:
Antony 2024-03-18 13:41:42 -04:00 committed by GitHub
parent 2c953914bc
commit adb866947b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -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,
}
}
}

View file

@ -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",