Browse Source

Revert "Try to fix recursion of vst ui resize"

This reverts commit f119412bc9.
tags/v2.1-rc1
falkTX 5 years ago
parent
commit
cf3e3fd023
1 changed files with 6 additions and 11 deletions
  1. +6
    -11
      source/backend/plugin/CarlaPluginVST2.cpp

+ 6
- 11
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -533,7 +533,7 @@ public:
ERect* vstRect = nullptr; ERect* vstRect = nullptr;
dispatcher(effEditGetRect, 0, 0, &vstRect); dispatcher(effEditGetRect, 0, 0, &vstRect);


if (vstRect != nullptr)
if (vstRect != nullptr && !fUI.isResized)
{ {
const int width(vstRect->right - vstRect->left); const int width(vstRect->right - vstRect->left);
const int height(vstRect->bottom - vstRect->top); const int height(vstRect->bottom - vstRect->top);
@@ -541,11 +541,7 @@ public:
CARLA_SAFE_ASSERT_INT2(width > 1 && height > 1, width, height); CARLA_SAFE_ASSERT_INT2(width > 1 && height > 1, width, height);


if (width > 1 && height > 1) if (width > 1 && height > 1)
{
fUI.isBeingResized = true;
fUI.window->setSize(static_cast<uint>(width), static_cast<uint>(height), true); fUI.window->setSize(static_cast<uint>(width), static_cast<uint>(height), true);
fUI.isBeingResized = false;
}
} }
} }
else else
@@ -554,6 +550,7 @@ public:
delete fUI.window; delete fUI.window;
fUI.window = nullptr; fUI.window = nullptr;
fUI.isOpen = false; fUI.isOpen = false;
fUI.isResized = false;
fUI.isVisible = false; fUI.isVisible = false;


carla_stderr2("Plugin refused to open its own UI"); carla_stderr2("Plugin refused to open its own UI");
@@ -2089,10 +2086,8 @@ protected:
CARLA_SAFE_ASSERT_BREAK(fUI.window != nullptr); CARLA_SAFE_ASSERT_BREAK(fUI.window != nullptr);
CARLA_SAFE_ASSERT_BREAK(index > 0); CARLA_SAFE_ASSERT_BREAK(index > 0);
CARLA_SAFE_ASSERT_BREAK(value > 0); CARLA_SAFE_ASSERT_BREAK(value > 0);
CARLA_SAFE_ASSERT_BREAK(!fUI.isBeingResized);
fUI.isBeingResized = true;
fUI.isResized = true;
fUI.window->setSize(static_cast<uint>(index), static_cast<uint>(value), true); fUI.window->setSize(static_cast<uint>(index), static_cast<uint>(value), true);
fUI.isBeingResized = false;
ret = 1; ret = 1;
break; break;


@@ -2583,14 +2578,14 @@ private:
} fEvents; } fEvents;


struct UI { struct UI {
bool isBeingResized;
bool isOpen; bool isOpen;
bool isResized;
bool isVisible; bool isVisible;
CarlaPluginUI* window; CarlaPluginUI* window;


UI() noexcept UI() noexcept
: isBeingResized(false),
isOpen(false),
: isOpen(false),
isResized(false),
isVisible(false), isVisible(false),
window(nullptr) {} window(nullptr) {}




Loading…
Cancel
Save