From f04bc94b80942857f8cc1e0d39658bd1eb633a06 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Thu, 27 May 2021 14:22:11 +0200 Subject: [PATCH 1/2] allow disabling drag and drop on windows --- winit/src/settings.rs | 2 ++ winit/src/settings/windows.rs | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 663fa07a..941d88ce 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -100,6 +100,8 @@ impl Window { if let Some(parent) = self.platform_specific.parent { window_builder = window_builder.with_parent_window(parent); } + window_builder = window_builder + .with_drag_and_drop(self.platform_specific.drag_and_drop); } window_builder diff --git a/winit/src/settings/windows.rs b/winit/src/settings/windows.rs index 76b8d067..68dadefd 100644 --- a/winit/src/settings/windows.rs +++ b/winit/src/settings/windows.rs @@ -2,8 +2,19 @@ //! Platform specific settings for Windows. /// The platform specific window settings of an application. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct PlatformSpecific { /// Parent Window pub parent: Option, + /// Drap and Drop support + pub drag_and_drop: bool, +} + +impl Default for PlatformSpecific { + fn default() -> Self { + Self { + parent: None, + drag_and_drop: true, + } + } } From 903570846e51df260925c81851d733dce5955b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n?= Date: Tue, 1 Jun 2021 18:57:36 +0700 Subject: [PATCH 2/2] Fix documentation of `PlatformSpecific` settings --- winit/src/settings/windows.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/winit/src/settings/windows.rs b/winit/src/settings/windows.rs index 68dadefd..fc26acd7 100644 --- a/winit/src/settings/windows.rs +++ b/winit/src/settings/windows.rs @@ -4,9 +4,10 @@ /// The platform specific window settings of an application. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct PlatformSpecific { - /// Parent Window + /// Parent window pub parent: Option, - /// Drap and Drop support + + /// Drag and drop support pub drag_and_drop: bool, }