Remove parent from PlatformSpecific window settings

This commit is contained in:
Héctor Ramón Jiménez 2024-06-14 02:23:25 +02:00
parent 4e7cbbf98a
commit b21e4567dc
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 1 additions and 13 deletions

View file

@ -33,8 +33,5 @@ web-time.workspace = true
dark-light.workspace = true dark-light.workspace = true
dark-light.optional = true dark-light.optional = true
[target.'cfg(windows)'.dependencies]
raw-window-handle.workspace = true
[dev-dependencies] [dev-dependencies]
approx = "0.5" approx = "0.5"

View file

@ -1,12 +1,8 @@
//! Platform specific settings for Windows. //! Platform specific settings for Windows.
use raw_window_handle::RawWindowHandle;
/// The platform specific window settings of an application. /// The platform specific window settings of an application.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PlatformSpecific { pub struct PlatformSpecific {
/// Parent window
pub parent: Option<RawWindowHandle>,
/// Drag and drop support /// Drag and drop support
pub drag_and_drop: bool, pub drag_and_drop: bool,
@ -17,7 +13,6 @@ pub struct PlatformSpecific {
impl Default for PlatformSpecific { impl Default for PlatformSpecific {
fn default() -> Self { fn default() -> Self {
Self { Self {
parent: None,
drag_and_drop: true, drag_and_drop: true,
skip_taskbar: false, skip_taskbar: false,
} }

View file

@ -73,11 +73,7 @@ pub fn window_attributes(
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
use winit::platform::windows::WindowAttributesExtWindows; use winit::platform::windows::WindowAttributesExtWindows;
#[allow(unsafe_code)]
unsafe {
attributes = attributes
.with_parent_window(settings.platform_specific.parent);
}
attributes = attributes attributes = attributes
.with_drag_and_drop(settings.platform_specific.drag_and_drop); .with_drag_and_drop(settings.platform_specific.drag_and_drop);