From 6f070150ea3f1e0d86e525d4f506c86d89f4573f Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 19 Mar 2023 13:36:50 +0100 Subject: [PATCH] Disable open::that() on Windows Until there's an alternative that doesn't panic. --- plugins/diopser/CHANGELOG.md | 15 +++++++++++++++ plugins/diopser/src/editor.rs | 15 ++++++++++----- plugins/spectral_compressor/CHANGELOG.md | 3 +++ plugins/spectral_compressor/src/editor.rs | 18 +++++++++++++----- 4 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 plugins/diopser/CHANGELOG.md diff --git a/plugins/diopser/CHANGELOG.md b/plugins/diopser/CHANGELOG.md new file mode 100644 index 00000000..2fd30e73 --- /dev/null +++ b/plugins/diopser/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic +Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Changed + +- On Windows, clicking on the plugin's name no longer takes you to Spectral + Compressor's home page. This is a temporary workaround for an issue with an + underlying library. diff --git a/plugins/diopser/src/editor.rs b/plugins/diopser/src/editor.rs index 348d3ff8..b8a462f0 100644 --- a/plugins/diopser/src/editor.rs +++ b/plugins/diopser/src/editor.rs @@ -93,11 +93,16 @@ fn top_bar(cx: &mut Context) { .top(Pixels(2.0)) .left(Pixels(8.0)) .on_mouse_down(|_, _| { - // Try to open the Diopser plugin's page when clicking on the title. If this fails - // then that's not a problem - let result = open::that(Diopser::URL); - if cfg!(debug) && result.is_err() { - nih_debug_assert_failure!("Failed to open web browser: {:?}", result); + // FIXME: On Windows this blocks, and while this is blocking a timer may proc which + // causes the window state to be mutably borrowed again, resulting in a + // panic. This needs to be fixed in baseview first. + if cfg!(not(windows)) { + // Try to open the Diopser plugin's page when clicking on the title. If this + // fails then that's not a problem + let result = open::that(Diopser::URL); + if cfg!(debug) && result.is_err() { + nih_debug_assert_failure!("Failed to open web browser: {:?}", result); + } } }); Label::new(cx, Diopser::VERSION) diff --git a/plugins/spectral_compressor/CHANGELOG.md b/plugins/spectral_compressor/CHANGELOG.md index 50330c07..f1ff9916 100644 --- a/plugins/spectral_compressor/CHANGELOG.md +++ b/plugins/spectral_compressor/CHANGELOG.md @@ -12,6 +12,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - The default window overlap amount setting has changed to 16x. Existing patches are not affected. +- On Windows, clicking on the plugin's name no longer takes you to Spectral + Compressor's home page. This is a temporary workaround for an issue with an + underlying library. ## [0.3.0] - 2023-01-15 diff --git a/plugins/spectral_compressor/src/editor.rs b/plugins/spectral_compressor/src/editor.rs index 52e48191..8cec2c64 100644 --- a/plugins/spectral_compressor/src/editor.rs +++ b/plugins/spectral_compressor/src/editor.rs @@ -115,11 +115,19 @@ fn main_column(cx: &mut Context) { ))]) .font_size(30.0) .on_mouse_down(|_, _| { - // Try to open the plugin's page when clicking on the title. If this fails - // then that's not a problem - let result = open::that(SpectralCompressor::URL); - if cfg!(debug) && result.is_err() { - nih_debug_assert_failure!("Failed to open web browser: {:?}", result); + // FIXME: On Windows this blocks, and while this is blocking a timer may + // proc which causes the window state to be mutably borrowed again, + // resulting in a panic. This needs to be fixed in baseview first. + if cfg!(not(windows)) { + // Try to open the plugin's page when clicking on the title. If this + // fails then that's not a problem + let result = open::that(SpectralCompressor::URL); + if cfg!(debug) && result.is_err() { + nih_debug_assert_failure!( + "Failed to open web browser: {:?}", + result + ); + } } }); Label::new(cx, SpectralCompressor::VERSION)