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
+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();