Skip to content

Commit

Permalink
VST3: Fix issue where Ardour would repeatedly try to resize editors
Browse files Browse the repository at this point in the history
Ardour seems to listen to the bounds of the plugin window, and will call
`onSize` on the plugin editor when move/resize events are sent to the X
window - even if the size of the window didn't really change. This can
result in an infinite resize loop, where calling `onSize` on the VST3
instance sends a resize event to the plugin window, and this event
causes Ardour to call `onSize` on the plugin view.

To get around this, the Linux ComponentPeer will no longer request a
bounds change from the window system if the requested bounds are the
same as the current bounds.
  • Loading branch information
reuk committed Mar 11, 2021
1 parent 68d30f9 commit d4e8020
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/juce_gui_basics/native/juce_linux_Windowing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ class LinuxComponentPeer : public ComponentPeer
//==============================================================================
void setBounds (const Rectangle<int>& newBounds, bool isNowFullScreen) override
{
bounds = newBounds.withSize (jmax (1, newBounds.getWidth()),
jmax (1, newBounds.getHeight()));
const auto correctedNewBounds = newBounds.withSize (jmax (1, newBounds.getWidth()),
jmax (1, newBounds.getHeight()));

if (bounds == correctedNewBounds && fullScreen == isNowFullScreen)
return;

bounds = correctedNewBounds;

updateScaleFactorFromNewBounds (bounds, false);

Expand Down

0 comments on commit d4e8020

Please sign in to comment.