From 1907d973977bb7ed6b37f75def65238955b74906 Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Fri, 23 Feb 2024 13:27:00 +1300 Subject: [PATCH 1/2] add option for undecorated_shadow on windows --- core/src/window/settings/windows.rs | 7 +++++++ winit/src/conversion.rs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/core/src/window/settings/windows.rs b/core/src/window/settings/windows.rs index d3bda25915..4dc53d094b 100644 --- a/core/src/window/settings/windows.rs +++ b/core/src/window/settings/windows.rs @@ -12,6 +12,12 @@ pub struct PlatformSpecific { /// Whether show or hide the window icon in the taskbar. pub skip_taskbar: bool, + + /// Shows or hides the background drop shadow for undecorated windows. + /// + /// The shadow is hidden by default. + /// Enabling the shadow causes a thin 1px line to appear on the top of the window. + pub undecorated_shadow: bool, } impl Default for PlatformSpecific { @@ -20,6 +26,7 @@ impl Default for PlatformSpecific { parent: None, drag_and_drop: true, skip_taskbar: false, + undecorated_shadow: false, } } } diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 3d2ba0a418..9dd99f7176 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -87,6 +87,9 @@ pub fn window_settings( window_builder = window_builder .with_skip_taskbar(settings.platform_specific.skip_taskbar); + + window_builder = window_builder + .with_undecorated_shadow(settings.platform_specific.undecorated_shadow); } #[cfg(target_os = "macos")] From f8e86d5b0e92ce5c2f54023eb65e81bfc231e3bd Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Fri, 23 Feb 2024 13:48:06 +1300 Subject: [PATCH 2/2] formated --- winit/src/conversion.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 9dd99f7176..9c5f668037 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -88,8 +88,9 @@ pub fn window_settings( window_builder = window_builder .with_skip_taskbar(settings.platform_specific.skip_taskbar); - window_builder = window_builder - .with_undecorated_shadow(settings.platform_specific.undecorated_shadow); + window_builder = window_builder.with_undecorated_shadow( + settings.platform_specific.undecorated_shadow, + ); } #[cfg(target_os = "macos")]