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

add option for undecorated_shadow on windows #2285

Merged
merged 2 commits into from
Sep 5, 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
7 changes: 7 additions & 0 deletions core/src/window/settings/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -20,6 +26,7 @@ impl Default for PlatformSpecific {
parent: None,
drag_and_drop: true,
skip_taskbar: false,
undecorated_shadow: false,
}
}
}
4 changes: 4 additions & 0 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ 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")]
Expand Down
Loading