1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-23 01:44:22 +00:00

VST3: Fix issue where Ardour would repeatedly try to resize editors

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.
This commit is contained in:
reuk 2021-03-11 15:19:23 +00:00
parent 68d30f9c8d
commit d4e802016a

View file

@ -83,8 +83,13 @@ public:
//==============================================================================
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);