mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Gate the new resizing behavior behind new option
This interferes with resizing plugins using resize handles, and since it only helps with two buggy plugins this seems like the best solution here.
This commit is contained in:
+13
-19
@@ -10,28 +10,22 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
### TODOs
|
### TODOs
|
||||||
|
|
||||||
- Remove the remaining mentions of `editor_double_embed` from the readme.
|
- Remove the note after the `editor_coordinate_hack` compatibility option in the
|
||||||
|
readme.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added a new `editor_coordinate_hack` option which replaces
|
||||||
|
`editor_double_embed`. This can be useful with buggy plugins that have their
|
||||||
|
editor GUIs misaligned after resizing the window because they draw their GUI
|
||||||
|
based on (top level) window's absolute screen coordinates instead of their own
|
||||||
|
relative coordinates. The known plugins that can benefit from this are
|
||||||
|
_PSPaudioware E27_ and _Soundtoys Crystallizer_.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- The `editor_double_embed` option added in yabridge 1.4.0 has been removed.
|
- The `editor_double_embed` option added in yabridge 1.4.0 has been removed as
|
||||||
This option was added to work around _PSPaudioware E27_ which used its parent
|
the `editor_coordinate_hack` option supersedes it.
|
||||||
window's position as an offset for drawing its GUI, and without this option
|
|
||||||
that GUI would be misaligned. The below change to yabridge's embedding method
|
|
||||||
supersedes this option, as it also fixes a similar issue for another plugin.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Yabridge's Wine window embedding now takes more measures to make sure that the
|
|
||||||
plugin draws itself properly in the top left corner of the window when windows
|
|
||||||
are being resized. This is needed for some buggy plugins that draw window
|
|
||||||
based on absolute screen coordinates, instead of their positioning within the
|
|
||||||
parent window, like the _Soundtoys_ plugins and older _PSPaudioware_ plugins.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed an offset editor GUI after clicking the 'Tweak' button in _Soundtoys
|
|
||||||
Crytallizer_.
|
|
||||||
|
|
||||||
### Packaging notes
|
### Packaging notes
|
||||||
|
|
||||||
|
|||||||
@@ -336,16 +336,16 @@ plugin._
|
|||||||
|
|
||||||
### Compatibility options
|
### Compatibility options
|
||||||
|
|
||||||
| Option | Values | Description |
|
| Option | Values | Description |
|
||||||
| --------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------ | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `disable_pipes` | `{true,false,<string>}` | 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](#runtime-dependencies-and-known-issues) 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`. |
|
| `disable_pipes` | `{true,false,<string>}` | 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](#runtime-dependencies-and-known-issues) 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_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`. _This option has been remvoed in the master branch version of yabridge._ |
|
| `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`. _In yabridge 3.5.2 there's a variation of this option called_ `editor_double_embed`_._ |
|
||||||
| `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`. |
|
| `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`. |
|
||||||
| `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 always work properly with it, but it could be useful in certain setups. You may need to use [this Wine patch](https://github.com/psycha0s/airwave/blob/master/fix-xembed-wine-windows.patch) if you're getting blank editor windows. 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 always work properly with it, but it could be useful in certain setups. You may need to use [this Wine patch](https://github.com/psycha0s/airwave/blob/master/fix-xembed-wine-windows.patch) if you're getting blank editor windows. Defaults to `false`. |
|
||||||
| `frame_rate` | `<number>` | 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`. |
|
| `frame_rate` | `<number>` | 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`. |
|
||||||
| `hide_daw` | `{true,false}` | Don't report the name of the actual DAW to the plugin. See the [known issues](#runtime-dependencies-and-known-issues) section for a list of situations where this may be useful. This affects both VST2 and VST3 plugins. Defaults to `false`. |
|
| `hide_daw` | `{true,false}` | Don't report the name of the actual DAW to the plugin. See the [known issues](#runtime-dependencies-and-known-issues) section for a list of situations where this may be useful. This affects both VST2 and VST3 plugins. Defaults to `false`. |
|
||||||
| `vst3_no_scaling` | `{true,false}` | Disable HiDPI scaling for VST3 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`. |
|
| `vst3_no_scaling` | `{true,false}` | Disable HiDPI scaling for VST3 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`. |
|
||||||
| `vst3_prefer_32bit` | `{true,false}` | Use the 32-bit version of a VST3 plugin instead the 64-bit version if both are installed and they're in the same VST3 bundle inside of `~/.vst3/yabridge`. You likely won't need this. |
|
| `vst3_prefer_32bit` | `{true,false}` | Use the 32-bit version of a VST3 plugin instead the 64-bit version if both are installed and they're in the same VST3 bundle inside of `~/.vst3/yabridge`. You likely won't need this. |
|
||||||
|
|
||||||
These options are workarounds for issues mentioned in the [known
|
These options are workarounds for issues mentioned in the [known
|
||||||
issues](#runtime-dependencies-and-known-issues) section. Depending on the hosts
|
issues](#runtime-dependencies-and-known-issues) section. Depending on the hosts
|
||||||
@@ -370,6 +370,9 @@ group = "melda"
|
|||||||
["ToneBoosters"]
|
["ToneBoosters"]
|
||||||
group = "toneboosters"
|
group = "toneboosters"
|
||||||
|
|
||||||
|
["PSPaudioware"]
|
||||||
|
editor_coordinate_hack = true
|
||||||
|
|
||||||
["Analog Lab 3.so"]
|
["Analog Lab 3.so"]
|
||||||
editor_xembed = true
|
editor_xembed = true
|
||||||
|
|
||||||
@@ -506,10 +509,10 @@ include:
|
|||||||
causing Wine and yabridge to eventually stop working after the system hits the
|
causing Wine and yabridge to eventually stop working after the system hits the
|
||||||
open file limit. To fix this, either unset `WINEESYNC` while using yabridge or
|
open file limit. To fix this, either unset `WINEESYNC` while using yabridge or
|
||||||
switch to using [_fsync_](#performance-tuning) instead.
|
switch to using [_fsync_](#performance-tuning) instead.
|
||||||
- **PSPaudioware** plugins with expandable GUIs, such as E27, may have their GUI
|
- **PSPaudioware** and **Soundtoys** plugins with expandable GUIs, such as E27
|
||||||
appear in the wrong location after the GUI has been expanded. You can enable
|
and Crystallizer, may have their GUI appear in the wrong location after the
|
||||||
an alternative [editor hosting mode](#compatibility-options) to fix this.
|
GUI has been expanded. You can enable an alternative [editor hosting
|
||||||
_This is no longer needed in the master branch version of yabridge._
|
mode](#compatibility-options) to fix this.
|
||||||
- When using recent _Applied Acoustics_ plugins like **Chromaphone 3** under
|
- When using recent _Applied Acoustics_ plugins like **Chromaphone 3** under
|
||||||
_Bitwig Studio_, text entry will cause the plugin to crash because Chromaphone
|
_Bitwig Studio_, text entry will cause the plugin to crash because Chromaphone
|
||||||
uses a different text entry method when it detects Bitwig. You can use the
|
uses a different text entry method when it detects Bitwig. You can use the
|
||||||
|
|||||||
@@ -101,6 +101,12 @@ Configuration::Configuration(const fs::path& config_path,
|
|||||||
} else {
|
} else {
|
||||||
invalid_options.push_back(key);
|
invalid_options.push_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.push_back(key);
|
||||||
|
}
|
||||||
} else if (key == "editor_force_dnd") {
|
} else if (key == "editor_force_dnd") {
|
||||||
if (const auto parsed_value = value.as_boolean()) {
|
if (const auto parsed_value = value.as_boolean()) {
|
||||||
editor_force_dnd = parsed_value->get();
|
editor_force_dnd = parsed_value->get();
|
||||||
|
|||||||
@@ -94,6 +94,18 @@ class Configuration {
|
|||||||
*/
|
*/
|
||||||
std::optional<boost::filesystem::path> disable_pipes;
|
std::optional<boost::filesystem::path> 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
|
* If set to `true`, we'll remove the `XdndAware` property all ancestor
|
||||||
* windows in `editor.cpp`. This is needed for REAPER as REAPER implements
|
* windows in `editor.cpp`. This is needed for REAPER as REAPER implements
|
||||||
@@ -188,6 +200,7 @@ class Configuration {
|
|||||||
|
|
||||||
s.ext(disable_pipes, bitsery::ext::InPlaceOptional(),
|
s.ext(disable_pipes, bitsery::ext::InPlaceOptional(),
|
||||||
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath{}); });
|
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath{}); });
|
||||||
|
s.value1b(editor_coordinate_hack);
|
||||||
s.value1b(editor_force_dnd);
|
s.value1b(editor_force_dnd);
|
||||||
s.value1b(editor_xembed);
|
s.value1b(editor_xembed);
|
||||||
s.ext(frame_rate, bitsery::ext::InPlaceOptional(),
|
s.ext(frame_rate, bitsery::ext::InPlaceOptional(),
|
||||||
|
|||||||
@@ -255,6 +255,9 @@ class PluginBridge {
|
|||||||
"hack: pipes disabled, plugin output will go to \"" +
|
"hack: pipes disabled, plugin output will go to \"" +
|
||||||
config.disable_pipes->string() + "\"");
|
config.disable_pipes->string() + "\"");
|
||||||
}
|
}
|
||||||
|
if (config.editor_coordinate_hack) {
|
||||||
|
other_options.push_back("editor: coordinate hack");
|
||||||
|
}
|
||||||
if (config.editor_force_dnd) {
|
if (config.editor_force_dnd) {
|
||||||
other_options.push_back("editor: force drag-and-drop");
|
other_options.push_back("editor: force drag-and-drop");
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-17
@@ -262,7 +262,8 @@ Editor::Editor(MainContext& main_context,
|
|||||||
Logger& logger,
|
Logger& logger,
|
||||||
const size_t parent_window_handle,
|
const size_t parent_window_handle,
|
||||||
std::optional<fu2::unique_function<void()>> timer_proc)
|
std::optional<fu2::unique_function<void()>> timer_proc)
|
||||||
: use_xembed(config.editor_xembed),
|
: use_coordinate_hack(config.editor_coordinate_hack),
|
||||||
|
use_xembed(config.editor_xembed),
|
||||||
logger(logger),
|
logger(logger),
|
||||||
x11_connection(xcb_connect(nullptr, nullptr), xcb_disconnect),
|
x11_connection(xcb_connect(nullptr, nullptr), xcb_disconnect),
|
||||||
dnd_proxy_handle(WineXdndProxy::get_handle()),
|
dnd_proxy_handle(WineXdndProxy::get_handle()),
|
||||||
@@ -440,23 +441,28 @@ void Editor::resize(uint16_t width, uint16_t height) {
|
|||||||
value_mask, values.data());
|
value_mask, values.data());
|
||||||
xcb_flush(x11_connection.get());
|
xcb_flush(x11_connection.get());
|
||||||
|
|
||||||
// Before lying to Wine about the window's coordinates, we do need to make
|
// When the `editor_coordinate_hack` option is enabled, we will make sure
|
||||||
// sure that the window is actually placed at (0, 0) coordinates. Otherwise
|
// that the window is actually placed at (0, 0) coordinates. Otherwise some
|
||||||
// some plugins that rely on screen coordinates, like the Soundtoys plugins
|
// plugins that rely on screen coordinates, like the Soundtoys plugins and
|
||||||
// and older PSPaudioware plugins, will draw their GUI at the wrong
|
// older PSPaudioware plugins, will draw their GUI at the wrong location
|
||||||
// location.
|
// because they look at the (top level) window's screen coordinates instead
|
||||||
logger.log_editor_trace([]() {
|
// of their own relative coordinates. We don't do by default as this also
|
||||||
return "DEBUG: Resetting Wine window position back to (0, 0)";
|
// interferes with resize handles.
|
||||||
});
|
if (use_coordinate_hack) {
|
||||||
SetWindowPos(win32_window.handle, nullptr, 0, 0, 0, 0,
|
logger.log_editor_trace([]() {
|
||||||
SWP_NOSIZE | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOCOPYBITS |
|
return "DEBUG: Resetting Wine window position back to (0, 0)";
|
||||||
SWP_NOOWNERZORDER | SWP_DEFERERASE);
|
});
|
||||||
|
SetWindowPos(win32_window.handle, nullptr, 0, 0, 0, 0,
|
||||||
|
SWP_NOSIZE | SWP_NOREDRAW | SWP_NOACTIVATE |
|
||||||
|
SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_DEFERERASE);
|
||||||
|
|
||||||
// Make sure that after the resize the screen coordinates always match up
|
// Make sure that after the resize the screen coordinates always match
|
||||||
// properly. Without this Soundtoys Crystallizer might appear choppy or skip
|
// up properly. Without this Soundtoys Crystallizer might appear choppy
|
||||||
// a frame during their resize animation (which somehow calls
|
// or skip a frame during their resize animation (which somehow calls
|
||||||
// `audioMasterSizeWindow()` with the same size a bunch of times in a row).
|
// `audioMasterSizeWindow()` with the same size a bunch of times in a
|
||||||
fix_local_coordinates();
|
// row).
|
||||||
|
fix_local_coordinates();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::handle_x11_events() noexcept {
|
void Editor::handle_x11_events() noexcept {
|
||||||
|
|||||||
@@ -265,11 +265,18 @@ class Editor {
|
|||||||
*/
|
*/
|
||||||
void run_timer_proc();
|
void run_timer_proc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use XEmbed instead of yabridge's normal window embedded. Wine
|
* Whether to use XEmbed instead of yabridge's normal window embedded. Wine
|
||||||
* with XEmbed tends to cause rendering issues, so it's disabled by default.
|
* with XEmbed tends to cause rendering issues, so it's disabled by default.
|
||||||
*/
|
*/
|
||||||
const bool use_xembed;
|
const bool use_xembed = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user