VST3: ignore GUI size allocations before realizing the view

This fixes crashes with some VST3s when calling `onSize()` before
attaching thew view (e.g. Reason Rack Plug on macOS).
This commit is contained in:
Robin Gareus 2020-11-19 23:11:01 +01:00
parent aef366c156
commit 7e2bb01ff1
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
5 changed files with 11 additions and 4 deletions

View file

@ -65,6 +65,7 @@ VST3HWNDPluginUI::view_realized ()
if (kResultOk != view->attached (reinterpret_cast<void*> (hwnd), Steinberg::kPlatformTypeHWND)) {
assert (0);
}
_view_realized = true;
ViewRect rect;
if (view->getSize (&rect) == kResultOk) {
@ -86,7 +87,7 @@ void
VST3HWNDPluginUI::view_size_allocate (Gtk::Allocation& allocation)
{
IPlugView* view = _vst3->view ();
if (!view) {
if (!view || !_view_realized) {
return;
}
PBD::Unwinder<bool> uw (_resize_in_progress, true);