mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-06 19:40:10 +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:
committed by
Robbert van der Helm
parent
8ec0f8b897
commit
f504da9e46
@@ -801,8 +801,13 @@ void Vst3Bridge::run() {
|
|||||||
.run_in_context([&, &instance = instance]() -> tresult {
|
.run_in_context([&, &instance = instance]() -> tresult {
|
||||||
Steinberg::ViewRect size;
|
Steinberg::ViewRect size;
|
||||||
std::optional<Size> initial_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(
|
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(),
|
initial_size.emplace(size.getWidth(),
|
||||||
size.getHeight());
|
size.getHeight());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user