Skip to content

Commit

Permalink
Fix live LV2 hosted plugin resizing
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Apr 20, 2024
1 parent 295f1e7 commit ce4c3e2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/Common/IldaeilUI.cpp
Expand Up @@ -175,6 +175,7 @@ class IldaeilUI : public UI,
bool fPluginHasFileOpen;
bool fPluginHasOutputParameters;
bool fPluginIsBridge;
bool fPluginIsIdling;
bool fPluginRunning;
bool fPluginWillRunInBridgeMode;
Mutex fPluginsMutex;
Expand Down Expand Up @@ -231,6 +232,7 @@ class IldaeilUI : public UI,
fPluginHasFileOpen(false),
fPluginHasOutputParameters(false),
fPluginIsBridge(false),
fPluginIsIdling(false),
fPluginRunning(false),
fPluginWillRunInBridgeMode(false),
fCurrentPluginInfo(),
Expand Down Expand Up @@ -716,6 +718,20 @@ class IldaeilUI : public UI,
return;
if (width < fCurrentConstraintSize.getWidth() || height + extraHeight < fCurrentConstraintSize.getHeight())
fUpdateGeometryConstraints = true;

if (fPluginIsIdling && fLastSize != fNextSize)
{
fLastSize = fNextSize;

if (fUpdateGeometryConstraints)
{
fUpdateGeometryConstraints = false;
fCurrentConstraintSize = fNextSize;
setGeometryConstraints(fNextSize.getWidth(), fNextSize.getHeight());
}

setSize(fNextSize);
}
}

#if DISTRHO_UI_USER_RESIZABLE
Expand Down Expand Up @@ -822,7 +838,10 @@ class IldaeilUI : public UI,
case kIdleGiveIdleToUI:
if (fPlugin->fCarlaPluginDescriptor->ui_idle != nullptr)
fPlugin->fCarlaPluginDescriptor->ui_idle(fPlugin->fCarlaPluginHandle);

fPluginIsIdling = true;
fPluginHostWindow.idle();
fPluginIsIdling = false;
break;

case kIdleChangePluginType:
Expand Down

0 comments on commit ce4c3e2

Please sign in to comment.