mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-05 10:56:13 +02:00
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:
parent
8ec0f8b897
commit
f504da9e46
@ -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());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user