From 49eeee99fa9a4f4728c20e86ac0e84e06a67b655 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 25 Dec 2020 18:11:55 +0100 Subject: [PATCH] Add an XEmbed compatibility option --- CHANGELOG.md | 9 +++++++-- README.md | 4 ++++ src/common/configuration.cpp | 6 ++++++ src/common/configuration.h | 9 +++++++++ src/plugin/bridges/common.h | 3 +++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bd784c7..d8cf67c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,13 @@ Versioning](https://semver.org/spec/v2.0.0.html). TODO: Add the relevant entries here for yabridge's VST3 support -- Added the `with-vst3` option to control whether yabridge should be built with - VST3 support. This is enabled by default. +- Added the `with-vst3` compile time option to control whether yabridge should + be built with VST3 support. This is enabled by default. +- Added an + [option](https://github.com/robbert-vdh/yabridge#compatibility-options) to use + XEmbed instead of yabridge's normal window embedding method. Some plugins have + redrawing issues when using XEmbed and editor resizing won't work, so it's not + recommended to use it as a default. ### Changed diff --git a/README.md b/README.md index f37e039a..7cbf6ed4 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,7 @@ other. See below for an [example](#example) of how these groups can be set up. | --------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cache_time_info` | `{true,false}` | Compatibility option for plugins that call `audioMasterGetTime()` multiple times during a single processing cycle. With this option subsequent calls during a single audio processing cycle will reuse the value returned by the first call to this function. This is a bug in the plugin, and this option serves as a temporary workaround until the plugin fixes the issue. | | `editor_double_embed` | `{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_ plugins with expandable GUIs, such as E27. Defaults to `false`. | +| `editor_xembed` | `{true,false}` | Use Wine's XEmbed implementation instead of yabridge's normal window embedding method. Some plugins will have redrawing issues when using XEmbed and editor resizing won't work properly with it, but it could be useful in certain setups. Defaults to `false`. | These options are workarounds for issues mentioned in the [known issues](#runtime-dependencies-and-known-issues) section. Depending on the hosts @@ -315,6 +316,9 @@ group = "toneboosters" ["PSPaudioware"] editor_double_embed = true +["Analog Lab 3.so"] +editor_xembed = true + ["SWAM Cello 64bit.so"] cache_time_info = true diff --git a/src/common/configuration.cpp b/src/common/configuration.cpp index 8f528a15..79c6e715 100644 --- a/src/common/configuration.cpp +++ b/src/common/configuration.cpp @@ -90,6 +90,12 @@ Configuration::Configuration(const fs::path& config_path, } else { invalid_options.push_back(key); } + } else if (key == "editor_xembed") { + if (const auto parsed_value = value.as_boolean()) { + editor_xembed = parsed_value->get(); + } else { + invalid_options.push_back(key); + } } else if (key == "group") { if (const auto parsed_value = value.as_string()) { group = parsed_value->get(); diff --git a/src/common/configuration.h b/src/common/configuration.h index e499fc73..3b061e3f 100644 --- a/src/common/configuration.h +++ b/src/common/configuration.h @@ -101,6 +101,14 @@ class Configuration { */ bool editor_double_embed = false; + /** + * Use XEmbed instead of yabridge's normal editor embedding method. Wine's + * XEmbed support is not very polished yet and tends to lead to rendering + * issues, so this is disabled by default. Also, editor resizing won't work + * reliably when XEmbed is enabled. + */ + bool editor_xembed = false; + /** * The name of the plugin group that should be used for the plugin this * configuration object was created for. If not set, then the plugin should @@ -135,6 +143,7 @@ class Configuration { void serialize(S& s) { s.value1b(cache_time_info); s.value1b(editor_double_embed); + s.value1b(editor_xembed); s.ext(group, bitsery::ext::StdOptional(), [](S& s, auto& v) { s.text1b(v, 4096); }); s.ext(matched_file, bitsery::ext::StdOptional(), diff --git a/src/plugin/bridges/common.h b/src/plugin/bridges/common.h index 32f5ea2e..cc08ecae 100644 --- a/src/plugin/bridges/common.h +++ b/src/plugin/bridges/common.h @@ -160,6 +160,9 @@ class PluginBridge { if (config.editor_double_embed) { other_options.push_back("editor: double embed"); } + if (config.editor_xembed) { + other_options.push_back("editor: XEmbed"); + } if (!other_options.empty()) { init_msg << join_quoted_strings(other_options) << std::endl; } else {