Browse Source

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.
tags/2021-05-28
reuk 4 years ago
parent
commit
d4e802016a
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      modules/juce_gui_basics/native/juce_linux_Windowing.cpp

+ 7
- 2
modules/juce_gui_basics/native/juce_linux_Windowing.cpp 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);


Loading…
Cancel
Save