VST3: work-around endless/recursive resize requests

Some plugins correct their own size when resized which can lead
to endlessly growing GUIs. In particular this issue exists
if Ardour's plugin-toolbar forces a plugin to grow in size to fill
the allocated space. While the plugin aims for fixed aspect-ratio.

This will need a proper solution involving VST's checkSizeConstraint,
however GTK+2 does not have an appropriate API...
This commit is contained in:
Robin Gareus 2020-09-18 02:11:25 +02:00
parent 5dc3f2a320
commit 67b1481c12
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
6 changed files with 18 additions and 16 deletions

View file

@ -25,6 +25,8 @@
#include <glibmm/main.h>
#include <gtkmm/socket.h>
#include "pbd/unwind.h"
#include "ardour/plugin_insert.h"
#include "ardour/vst3_plugin.h"
@ -212,6 +214,8 @@ VST3X11PluginUI::view_size_allocate (Gtk::Allocation& allocation)
if (!view) {
return;
}
PBD::Unwinder<bool> uw (_resize_in_progress, true);
ViewRect rect;
if (view->getSize (&rect) == kResultOk) {
rect.right = rect.left + allocation.get_width ();
@ -234,7 +238,7 @@ VST3X11PluginUI::resize_callback (int width, int height)
{
// printf ("VST3X11PluginUI::resize_callback %d x %d\n", width, height);
IPlugView* view = _vst3->view ();
if (!view) {
if (!view || _resize_in_progress) {
return;
}
if (view->canResize() == kResultTrue) {