From 66840d4d16b894ae28f197bcbb49ddbab0c2bfa1 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 1 Mar 2025 19:17:29 +0100 Subject: [PATCH] Remove the editor_coordinate_hack option I'm not sure if this would still be necessary with the new embedding approach, but it definitely does cause more problems than it solves. --- CHANGELOG.md | 3 +++ README.md | 4 ---- src/common/configuration.cpp | 6 ------ src/common/configuration.h | 13 ------------- src/plugin/bridges/common.h | 3 --- src/wine-host/editor.cpp | 19 +------------------ src/wine-host/editor.h | 7 ------- 7 files changed, 4 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cef69a2..b4ee42f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - The `editor_xembed` compatibility option has been removed. This option hasn't worked properly for the last couple major Wine releases. +- The `editor_coordinate_hack` compatibility option has been removed. This was a + very specific option to work around a very specific problem, and its existence + resulted in more confusion than it solved problems. - Out of the box support for building a 32-bit version of yabridge for use in 64-bit machines has been dropped as part of solving a compatibility issue with newer Meson versions diff --git a/README.md b/README.md index c6df1a70..33d76863 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,6 @@ you load a new plugin._ | Option | Values | Description | | ----------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `disable_pipes` | `{true,false,}` | When this option is enabled, yabridge will redirect the Wine plugin host's output streams to a file without any further processing. See the [known issues](#known-issues-and-fixes) section for a list of plugins where this may be useful. This can be set to a boolean, in which case the output will be written to `$XDG_RUNTIME_DIR/yabridge-plugin-output.log`, or to an absolute path (with no expansion for tildes or environment variables). Defaults to `false`. | -| `editor_coordinate_hack` | `{true,false}` | Compatibility option for plugins that rely on the absolute screen coordinates of the window they're embedded in. Since the Wine window gets embedded inside of a window provided by your DAW, these coordinates won't match up and the plugin would end up drawing in the wrong location without this option. Currently the only known plugins that require this option are _PSPaudioware E27_ and _Soundtoys Crystallizer_. Defaults to `false`. | | `editor_disable_host_scaling` | `{true,false}` | Disable host-driven HiDPI scaling for VST3 and CLAP plugins. Wine currently does not have proper fractional HiDPI support, so you might have to enable this option if you're using a HiDPI display. In most cases setting the font DPI in `winecfg`'s graphics tab to 192 will cause plugins to scale correctly at 200% size. Defaults to `false`. | | `editor_force_dnd` | `{true,false}` | This option forcefully enables drag-and-drop support in _REAPER_. Because REAPER's FX window supports drag-and-drop itself, dragging a file onto a plugin editor will cause the drop to be intercepted by the FX window. This makes it impossible to drag files onto plugins in REAPER under normal circumstances. Setting this option to `true` will strip drag-and-drop support from the FX window, thus allowing files to be dragged onto the plugin again. Defaults to `false`. | | `frame_rate` | `` | The rate at which Win32 events are being handled and usually also the refresh rate of a plugin's editor GUI. When using plugin groups all plugins share the same event handling loop, so in those the last loaded plugin will set the refresh rate. Defaults to `60`. | @@ -364,9 +363,6 @@ group = "melda" ["ToneBoosters"] group = "toneboosters" -["PSPaudioware"] -editor_coordinate_hack = true - ["Chromaphone 3.so"] hide_daw = true diff --git a/src/common/configuration.cpp b/src/common/configuration.cpp index 8c5aa30c..979d9335 100644 --- a/src/common/configuration.cpp +++ b/src/common/configuration.cpp @@ -97,12 +97,6 @@ Configuration::Configuration(const fs::path& config_path, } else { invalid_options.emplace_back(key); } - } else if (key == "editor_coordinate_hack") { - if (const auto parsed_value = value.as_boolean()) { - editor_coordinate_hack = parsed_value->get(); - } else { - invalid_options.emplace_back(key); - } } else if (key == "editor_disable_host_scaling") { if (const auto parsed_value = value.as_boolean()) { editor_disable_host_scaling = parsed_value->get(); diff --git a/src/common/configuration.h b/src/common/configuration.h index 20d59ddc..12bcbffe 100644 --- a/src/common/configuration.h +++ b/src/common/configuration.h @@ -91,18 +91,6 @@ class Configuration { */ std::optional disable_pipes; - /** - * If this is set to `true`, then the after every resize we will move the - * embedded Wine window back to `(0, 0)` and then do the coordinate fixing - * trick again. This may be useful with buggy plugins that draw their GUI - * based on the (top level) window's position. Otherwise those GUIs will be - * offset by the window's actual position on screen. The only plugins I've - * encountered where this was necessary were PSPaudioware E27 and Soundtoys - * Crystallizer. This is not enabled by default, because it also interferes - * with resize handles. - */ - bool editor_coordinate_hack = false; - /** * If set to `true`, we'll remove the `XdndAware` property all ancestor * windows in `editor.cpp`. This is needed for REAPER as REAPER implements @@ -189,7 +177,6 @@ class Configuration { s.ext(disable_pipes, bitsery::ext::InPlaceOptional(), [](S& s, auto& v) { s.ext(v, bitsery::ext::GhcPath{}); }); - s.value1b(editor_coordinate_hack); s.value1b(editor_force_dnd); s.ext(frame_rate, bitsery::ext::InPlaceOptional(), [](S& s, auto& v) { s.value4b(v); }); diff --git a/src/plugin/bridges/common.h b/src/plugin/bridges/common.h index 5d45f5d1..ad4b7622 100644 --- a/src/plugin/bridges/common.h +++ b/src/plugin/bridges/common.h @@ -289,9 +289,6 @@ class PluginBridge { "hack: pipes disabled, plugin output will go to \"" + config_.disable_pipes->string() + "\""); } - if (config_.editor_coordinate_hack) { - other_options.push_back("editor: coordinate hack"); - } if (config_.editor_disable_host_scaling) { other_options.push_back("editor: no host DPI scaling"); } diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index fcdc5bb6..de895dbb 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -257,8 +257,7 @@ Editor::Editor(MainContext& main_context, Logger& logger, const size_t parent_window_handle, std::optional> timer_proc) - : use_coordinate_hack_(config.editor_coordinate_hack), - use_force_dnd_(config.editor_force_dnd), + : use_force_dnd_(config.editor_force_dnd), logger_(logger), x11_connection_(xcb_connect(nullptr, nullptr), xcb_disconnect), dnd_proxy_handle_(WineXdndProxy::get_handle()), @@ -401,22 +400,6 @@ void Editor::resize(uint16_t width, uint16_t height) { // using the CLAP JUCE Extensions. wrapper_window_size_.width = width; wrapper_window_size_.height = height; - - // When the `editor_coordinate_hack` option is enabled, we will make sure - // that the window is actually placed at (0, 0) coordinates. Otherwise some - // plugins that rely on screen coordinates, like the Soundtoys plugins and - // older PSPaudioware plugins, will draw their GUI at the wrong location - // because they look at the (top level) window's screen coordinates instead - // of their own relative coordinates. We don't do by default as this also - // interferes with resize handles. - if (use_coordinate_hack_) { - logger_.log_editor_trace([]() { - return "DEBUG: Resetting Wine window position back to (0, 0)"; - }); - SetWindowPos(win32_window_.handle_, nullptr, 0, 0, 0, 0, - SWP_NOSIZE | SWP_NOREDRAW | SWP_NOACTIVATE | - SWP_NOOWNERZORDER | SWP_DEFERERASE | SWP_NOCOPYBITS); - } } void Editor::show() noexcept { diff --git a/src/wine-host/editor.h b/src/wine-host/editor.h index 9d6449c0..7b4786f6 100644 --- a/src/wine-host/editor.h +++ b/src/wine-host/editor.h @@ -267,13 +267,6 @@ class Editor { */ inline Size size() const noexcept { return wrapper_window_size_; } - /** - * Whether to reposition `win32_window_` to (0, 0) every time the window - * resizes. This can help with buggy plugins that use the (top level) - * window's screen coordinates when drawing their GUI. - */ - const bool use_coordinate_hack_; - /** * Whether the `editor_force_dnd` workaround for REAPER should be activated. * See the implementation in `editor.cpp` for more details.