Browse Source

VST3 Host: Ensure requested size is applied, even when plugin does not support scaling

This fixes some issues with Izotope Ozone 9:
- Resizing would stutter, and could leave the view in an inconsistent
  state.
- Closing and reopening the view after resizing would display black bars
  around the editor view.

The root of the problem was that the call to Component::setSize() inside
the resizeView call checked whether the plugin supported resizing. If
not, it would force the embedded view back to the current size. This
behaviour is incorrect - if the plugin requests a resize via resizeView,
the new size should be applied whether or not the plugin "supports
resizing".
v6.1.6
reuk 4 years ago
parent
commit
61cdcff2e9
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp

+ 7
- 0
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -1525,6 +1525,8 @@ private:
tresult PLUGIN_API resizeView (IPlugView* incomingView, ViewRect* newSize) override tresult PLUGIN_API resizeView (IPlugView* incomingView, ViewRect* newSize) override
{ {
const ScopedValueSetter<bool> recursiveResizeSetter (recursiveResize, true);
if (incomingView != nullptr && newSize != nullptr && incomingView == view) if (incomingView != nullptr && newSize != nullptr && incomingView == view)
{ {
auto scaleToViewRect = [this] (int dimension) auto scaleToViewRect = [this] (int dimension)
@@ -1536,6 +1538,11 @@ private:
auto oldHeight = scaleToViewRect (getHeight()); auto oldHeight = scaleToViewRect (getHeight());
resizeWithRect (embeddedComponent, *newSize, nativeScaleFactor); resizeWithRect (embeddedComponent, *newSize, nativeScaleFactor);
#if JUCE_WINDOWS
setPluginWindowPos (*newSize);
#endif
setSize (embeddedComponent.getWidth(), embeddedComponent.getHeight()); setSize (embeddedComponent.getWidth(), embeddedComponent.getHeight());
// According to the VST3 Workflow Diagrams, a resizeView from the plugin should // According to the VST3 Workflow Diagrams, a resizeView from the plugin should


Loading…
Cancel
Save