VST3: Fix reparenting error when opening certain plugins

Fixes an issue where reparenting fails when the initial size returned by
the plugin is 0x0, i.e., invalid.
This commit is contained in:
Juuso Kaitila 2026-01-20 18:18:36 +02:00 committed by Robbert van der Helm
parent 8ec0f8b897
commit f504da9e46

View File

@ -801,8 +801,13 @@ void Vst3Bridge::run() {
.run_in_context([&, &instance = instance]() -> tresult {
Steinberg::ViewRect size;
std::optional<Size> initial_size;
// Only accept the initial size from the plugin if it's
// valid. Some plugins like Spectrasonics' Omnisphere 2
// return 0x0 for the initial size, which breaks our
// reparenting in the editor.
if (instance.plug_view_instance->plug_view->getSize(
&size) == Steinberg::kResultOk) {
&size) == Steinberg::kResultOk &&
size.getWidth() > 0 && size.getHeight() > 0) {
initial_size.emplace(size.getWidth(),
size.getHeight());
}