Revert "Inhibit the event loop during VST3 editor init"

This reverts commit ff76e482f2.

This was a workaround for a race condition in Nimble Kick when opening
the editor while the plugin has not yet been authorized (a Win32 timer
proc between `IEditController::createView()` and `IPlugView::attached()`
would cause a stack overflow because the plugin doesn't check if the
things it wants to use have actually been initialized yet).

But as it turns out, Bitwig Studio now calls
`IEditController::createView()` unconditionally when loading a VST3
plugin, regardless of whether the user wants to open the editor or not.
So this workaround would cause the message loop to be stalled
indefinitely until you open the editor. Since this would also cause
Nimble Kick to break in the Windows version of Bitwig, we'll simply
revert this workaround. If you need to activate the plugin on Linux, you
can load it in the Windows version of REAPER running under Wine instead.
After that the plugin will work just fine under yabridge.
This commit is contained in:
Robbert van der Helm
2021-07-29 13:46:07 +02:00
parent 43e27d76fe
commit 762e622416
2 changed files with 12 additions and 29 deletions
+9
View File
@@ -15,6 +15,15 @@ Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed
- Reverted the workaround for _Nimble Kick_ freezing added in yabridge 3.5.0.
This could cause VST3 plugins in **Bitwig Studio** to not process their
message loop and thus potentially freeze when using multiple instances of the
plugin. Bitwig now always initializes calls `IEditController::createView()`,
even if the user doesn't open the plugin's editor. Our workaround for the
Nimble Kick race condition expected this to be immediately followed by
`IPlugView::attached()`, which is not the case here. Since the plugin would
also cause the native Windows version of Bitwig Studio to crash, we'll thus
just simply revert this change.
- Changed how input focus releasing works by more specifically ignoring events
where the mouse pointer is still hovering over a Wine window instead of
ignoring a wider class of events. This should fix some edge cases where input
+3 -29
View File
@@ -499,16 +499,6 @@ void Vst3Bridge::run() {
if (plug_view) {
instance.plug_view_instance.emplace(plug_view);
// HACK: Nimble Kick (and perhaps other plugins, but
// I haven't heard any reports of this being
// an issue coming from other plugins) starts
// a timer in `IEditController::createView()`
// that relies on data that is only
// initialized once `IPlugView::attached()`
// has been called. So until that point, we'll
// prevent the event loop from running.
instance.is_initialized = false;
} else {
instance.plug_view_instance.reset();
}
@@ -749,28 +739,12 @@ void Vst3Bridge::run() {
editor_instance.get_win32_handle(),
type.c_str());
// Set the window's initial size according to what the
// plugin reports. Otherwise get rid of the editor again
// if the plugin didn't embed itself in it.
if (result == Steinberg::kResultOk) {
Steinberg::ViewRect size{};
if (instance.plug_view_instance->plug_view->getSize(
&size) == Steinberg::kResultOk) {
instance.editor->resize(size.getWidth(),
size.getHeight());
}
} else {
// Get rid of the editor again if the plugin didn't
// embed itself in it
if (result != Steinberg::kResultOk) {
instance.editor.reset();
}
// HACK: See the comment in our handling of
// `IEditController::createView()`. We'll reset
// this regardless of whether or not this request
// succeeded or else JUCE plugins without editors
// might cause us to get stuck in a situation
// where the event loop gets blocked indefinitely.
instance.is_initialized = true;
return result;
})
.get();