From 8ebb398a740a0a770bfa423a9301bc1a74fea187 Mon Sep 17 00:00:00 2001 From: Dan Wilhelm Date: Sun, 8 Aug 2021 19:12:01 -0700 Subject: [PATCH] Remove windows drag-and-drop method --- examples/audio/feedback.rs | 1 - examples/audio/hrtf-noise.rs | 1 - examples/audio/record_wav.rs | 1 - examples/audio/simple_audio.rs | 1 - examples/audio/simple_audio_file.rs | 1 - guide/src/changelog.md | 2 ++ nannou/src/window.rs | 21 --------------------- 7 files changed, 2 insertions(+), 26 deletions(-) diff --git a/examples/audio/feedback.rs b/examples/audio/feedback.rs index 47cc57139..f3d70d859 100644 --- a/examples/audio/feedback.rs +++ b/examples/audio/feedback.rs @@ -26,7 +26,6 @@ struct OutputModel { fn model(app: &App) -> Model { // Create a window to receive key pressed events. app.new_window() - .windowsos_drag_and_drop(false) // Required for Windows (no effect otherwise) .key_pressed(key_pressed) .view(view) .build() diff --git a/examples/audio/hrtf-noise.rs b/examples/audio/hrtf-noise.rs index 4f08ef575..e1061a770 100644 --- a/examples/audio/hrtf-noise.rs +++ b/examples/audio/hrtf-noise.rs @@ -66,7 +66,6 @@ impl HrtfData { fn model(app: &App) -> Model { app.new_window() - .windowsos_drag_and_drop(false) // Required for Windows (no effect otherwise) .size(WINDOW_SIDE, WINDOW_SIDE) .key_pressed(key_pressed) .mouse_moved(mouse_moved) diff --git a/examples/audio/record_wav.rs b/examples/audio/record_wav.rs index adf4f1c2e..8ee69aaa8 100644 --- a/examples/audio/record_wav.rs +++ b/examples/audio/record_wav.rs @@ -25,7 +25,6 @@ struct CaptureModel { fn model(app: &App) -> Model { // Create a window to receive key pressed events. app.new_window() - .windowsos_drag_and_drop(false) // Required for Windows (no effect otherwise) .key_pressed(key_pressed) .view(view) .build() diff --git a/examples/audio/simple_audio.rs b/examples/audio/simple_audio.rs index 2a6e8625d..851319b4c 100644 --- a/examples/audio/simple_audio.rs +++ b/examples/audio/simple_audio.rs @@ -19,7 +19,6 @@ struct Audio { fn model(app: &App) -> Model { // Create a window to receive key pressed events. app.new_window() - .windowsos_drag_and_drop(false) // Required for Windows (no effect otherwise) .key_pressed(key_pressed) .view(view) .build() diff --git a/examples/audio/simple_audio_file.rs b/examples/audio/simple_audio_file.rs index a0c97e11b..3ebd4402a 100644 --- a/examples/audio/simple_audio_file.rs +++ b/examples/audio/simple_audio_file.rs @@ -17,7 +17,6 @@ struct Audio { fn model(app: &App) -> Model { // Create a window to receive key pressed events. app.new_window() - .windowsos_drag_and_drop(false) // Required for Windows (no effect otherwise) .key_pressed(key_pressed) .view(view) .build() diff --git a/guide/src/changelog.md b/guide/src/changelog.md index b728c3911..b50528dde 100644 --- a/guide/src/changelog.md +++ b/guide/src/changelog.md @@ -20,6 +20,8 @@ back to the origins. - Fix audio examples on Windows by adding `WindowBuilder` method `windowsos_drag_and_drop`. Disabling this allows `cpal` and `winit` to coexist on the same thread. - Add community tutorials section to the guide. - Provided an user-friendly way to get the character value of a pressed keyboard key. +- Clear swapchain background automatically when re-allocated. Can set the clear color via `WindowBuilder::clear_color()`. +- Remove `windowsos_drag_and_drop()`, since `cpal` and `winit` can now share a thread. --- diff --git a/nannou/src/window.rs b/nannou/src/window.rs index 6ef4d182d..c498ebd73 100644 --- a/nannou/src/window.rs +++ b/nannou/src/window.rs @@ -23,9 +23,6 @@ use winit::dpi::{LogicalSize, PhysicalSize}; pub use winit::window::Fullscreen; pub use winit::window::WindowId as Id; -#[cfg(target_os = "windows")] -use winit::platform::windows::WindowBuilderExtWindows; - /// The default dimensions used for a window in the case that none are specified. pub const DEFAULT_DIMENSIONS: LogicalSize = LogicalSize { width: 1024.0, @@ -1040,24 +1037,6 @@ impl<'app> Builder<'app> { pub fn window_icon(self, window_icon: Option) -> Self { self.map_window(|w| w.with_window_icon(window_icon)) } - - /// On Windows only, enables or disables drag & drop onto the window. - /// On non-Windows, drag & drop is enabled and this function has no effect. - /// To use `nannou_audio` on Windows on the same thread, disable this. - /// - /// NOTE: Drag & drop requires multi-threaded COM, which can interfere with - /// other crates such as `cpal` and `nannou_audio` on the same thread. - #[allow(unused_variables)] - pub fn windowsos_drag_and_drop(self, drag_and_drop: bool) -> Self { - #[cfg(target_os = "windows")] - { - self.map_window(|w| w.with_drag_and_drop(drag_and_drop)) - } - #[cfg(not(target_os = "windows"))] - { - self - } - } } impl Window {