Browse Source

Fix VST2 and VST3 custom UI embed

Signed-off-by: falkTX <falktx@falktx.com>
pull/1780/head
falkTX 1 year ago
parent
commit
8c95a54a36
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 20 additions and 19 deletions
  1. +15
    -15
      source/backend/plugin/CarlaPluginVST2.cpp
  2. +5
    -4
      source/backend/plugin/CarlaPluginVST3.cpp

+ 15
- 15
source/backend/plugin/CarlaPluginVST2.cpp 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,18 +677,12 @@ public:

void uiIdle() override
{
if (fUI.isVisible)
dispatcher(effEditIdle);

if (fUI.window != nullptr)
{
fUI.window->idle();

if (fUI.isVisible)
dispatcher(effEditIdle);
}
else if (fUI.isEmbed)
{
dispatcher(effEditIdle);
}

CarlaPlugin::uiIdle();
}



+ 5
- 4
source/backend/plugin/CarlaPluginVST3.cpp 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);


Loading…
Cancel
Save