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
@ -259,6 +259,17 @@ pub struct Window {
|
|||||||
///
|
///
|
||||||
/// - **Android / Wayland / Web:** Unsupported.
|
/// - **Android / Wayland / Web:** Unsupported.
|
||||||
pub visible: bool,
|
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 {
|
impl Default for Window {
|
||||||
@ -287,6 +298,7 @@ impl Default for Window {
|
|||||||
canvas: None,
|
canvas: None,
|
||||||
window_theme: None,
|
window_theme: None,
|
||||||
visible: true,
|
visible: true,
|
||||||
|
skip_taskbar: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,12 @@ impl WinitWindows {
|
|||||||
.with_transparent(window.transparent)
|
.with_transparent(window.transparent)
|
||||||
.with_visible(window.visible);
|
.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(
|
#[cfg(any(
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
target_os = "dragonfly",
|
target_os = "dragonfly",
|
||||||
|
Loading…
Reference in New Issue
Block a user