Fix VST2 and VST3 custom UI embed

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2023-05-15 22:43:36 +02:00
parent 3f1bcaf791
commit 8c95a54a36
No known key found for this signature in database
GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 21 additions and 20 deletions

View File

@ -116,8 +116,7 @@ public:
// close UI
if (pData->hints & PLUGIN_HAS_CUSTOM_UI)
{
if (! fUI.isEmbed)
showCustomUI(false);
showCustomUI(false);
if (fUI.isOpen)
{
@ -614,8 +613,15 @@ public:
{
fUI.isVisible = false;
CARLA_SAFE_ASSERT_RETURN(fUI.window != nullptr,);
fUI.window->hide();
if (fUI.window != nullptr)
fUI.window->hide();
if (fUI.isEmbed)
{
fUI.isEmbed = false;
fUI.isOpen = false;
dispatcher(effEditClose);
}
}
}
@ -627,14 +633,14 @@ public:
fUI.isOpen = true;
fUI.isVisible = true;
#ifndef CARLA_OS_MAC
#ifndef CARLA_OS_MAC
// inform plugin of what UI scale we use
dispatcher(effVendorSpecific,
CCONST('P', 'r', 'e', 'S'),
CCONST('A', 'e', 'C', 's'),
nullptr,
pData->engine->getOptions().uiScale);
#endif
#endif
dispatcher(effEditOpen, 0, 0, ptr);
@ -671,17 +677,11 @@ public:
void uiIdle() override
{
if (fUI.window != nullptr)
{
fUI.window->idle();
if (fUI.isVisible)
dispatcher(effEditIdle);
}
else if (fUI.isEmbed)
{
if (fUI.isVisible)
dispatcher(effEditIdle);
}
if (fUI.window != nullptr)
fUI.window->idle();
CarlaPlugin::uiIdle();
}

View File

@ -1721,15 +1721,16 @@ public:
{
fUI.isVisible = false;
if (fUI.isEmbed && fUI.isAttached)
if (fUI.window != nullptr)
fUI.window->hide();
if (fUI.isEmbed)
{
fUI.isAttached = false;
fUI.isEmbed = false;
v3_cpp_obj(fV3.view)->set_frame(fV3.view, nullptr);
v3_cpp_obj(fV3.view)->removed(fV3.view);
}
if (fUI.window != nullptr)
fUI.window->hide();
}
runIdleCallbacksAsNeeded(true);