diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index b4bad915a1..90a17493fa 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -1126,23 +1126,21 @@ public: void resized() override { + auto newBounds = getLocalBounds(); + + #if JUCE_WINDOWS && JUCE_WIN_PER_MONITOR_DPI_AWARE + if (! lastBounds.isEmpty() && isWithin (newBounds.toDouble().getAspectRatio(), lastBounds.toDouble().getAspectRatio(), 0.1)) + return; + + lastBounds = newBounds; + #endif + if (auto* ed = getEditorComp()) { ed->setTopLeftPosition (0, 0); if (shouldResizeEditor) - { - auto newBounds = getLocalBounds(); - - #if JUCE_WINDOWS && JUCE_WIN_PER_MONITOR_DPI_AWARE - if (! lastBounds.isEmpty() && isWithin (newBounds.toDouble().getAspectRatio(), lastBounds.toDouble().getAspectRatio(), 0.1)) - return; - - lastBounds = newBounds; - #endif - ed->setBounds (ed->getLocalArea (this, newBounds)); - } updateWindowSize (false); } @@ -1153,6 +1151,11 @@ public: #endif } + void parentSizeChanged() override + { + updateWindowSize (true); + } + void childBoundsChanged (Component*) override { updateWindowSize (false); diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 266c65acb7..d99dcb18b5 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -1452,6 +1452,15 @@ private: } } + void parentSizeChanged() override + { + if (pluginEditor != nullptr) + { + resizeHostWindow(); + pluginEditor->repaint(); + } + } + void resizeHostWindow() { if (pluginEditor != nullptr) @@ -1477,7 +1486,7 @@ private: #if JUCE_MAC if (host.isWavelab() || host.isReaper()) #else - if (host.isWavelab() || host.isAbletonLive()) + if (host.isWavelab() || host.isAbletonLive() || host.isBitwigStudio()) #endif setBounds (0, 0, w, h); }