VST3: Prevent recursive endless resizing
Skip call to onSize() when the plugin's size already matches. https://github.com/Ardour/ardour/pull/599 https://github.com/juce-framework/JUCE/pull/867 https://discourse.ardour.org/t/sonobus-vst3-gui-hogs-cpu-only-when-ran-inside-ardour-on-linux-but-not-windows/105573
This commit is contained in:
parent
e07b3104bb
commit
9f3fba6988
@ -94,7 +94,9 @@ VST3HWNDPluginUI::view_size_allocate (Gtk::Allocation& allocation)
|
||||
}
|
||||
PBD::Unwinder<bool> uw (_resize_in_progress, true);
|
||||
ViewRect rect;
|
||||
if (view->getSize (&rect) == kResultOk) {
|
||||
if (view->getSize (&rect) == kResultOk
|
||||
&& ! (rect.right - rect.left == allocation.get_width () && rect.bottom - rect.top == allocation.get_height ()))
|
||||
{
|
||||
rect.right = rect.left + allocation.get_width ();
|
||||
rect.bottom = rect.top + allocation.get_height ();
|
||||
#if 0
|
||||
|
@ -122,7 +122,9 @@ VST3NSViewPluginUI::view_size_allocate (Gtk::Allocation& allocation)
|
||||
PBD::Unwinder<bool> uw (_resize_in_progress, true);
|
||||
|
||||
ViewRect rect;
|
||||
if (view->getSize (&rect) == kResultOk) {
|
||||
if (view->getSize (&rect) == kResultOk
|
||||
&& !(rect.right - rect.left == allocation.get_width () && rect.bottom - rect.top == allocation.get_height () && rect.left == xx && rect.top == yy))
|
||||
{
|
||||
rect.left = xx;
|
||||
rect.top = yy;
|
||||
rect.right = rect.left + allocation.get_width ();
|
||||
|
@ -247,7 +247,9 @@ VST3X11PluginUI::view_size_allocate (Gtk::Allocation& allocation)
|
||||
PBD::Unwinder<bool> uw (_resize_in_progress, true);
|
||||
|
||||
ViewRect rect;
|
||||
if (view->getSize (&rect) == kResultOk) {
|
||||
if (view->getSize (&rect) == kResultOk
|
||||
&& ! (rect.right - rect.left == allocation.get_width () && rect.bottom - rect.top == allocation.get_height ()))
|
||||
{
|
||||
rect.right = rect.left + allocation.get_width ();
|
||||
rect.bottom = rect.top + allocation.get_height ();
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user