Browse Source

Fix embed external ui closing too early

Signed-off-by: falkTX <falktx@falktx.com>
pull/314/head
falkTX 4 years ago
parent
commit
44ea88dd80
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 14 additions and 4 deletions
  1. +4
    -4
      distrho/extra/ExternalWindow.hpp
  2. +10
    -0
      examples/EmbedExternalUI/EmbedExternalExampleUI.cpp

+ 4
- 4
distrho/extra/ExternalWindow.hpp View File

@@ -79,10 +79,7 @@ public:

virtual bool isQuitting() const
{
if (ext.inUse)
return ext.isQuitting;

return !isVisible();
return ext.inUse ? ext.isQuitting : pData.isQuitting;
}

/**
@@ -90,6 +87,7 @@ public:
*/
virtual void close()
{
pData.isQuitting = true;
hide();

if (ext.inUse)
@@ -436,6 +434,7 @@ private:
uint height;
double scaleFactor;
String title;
bool isQuitting;
bool visible;

PrivateData()
@@ -445,6 +444,7 @@ private:
height(1),
scaleFactor(1.0),
title(),
isQuitting(false),
visible(false) {}
} pData;



+ 10
- 0
examples/EmbedExternalUI/EmbedExternalExampleUI.cpp View File

@@ -125,6 +125,16 @@ protected:
/* --------------------------------------------------------------------------------------------------------
* External Window overrides */

uintptr_t getNativeWindowHandle() const noexcept override
{
#if defined(DISTRHO_OS_MAC)
#elif defined(DISTRHO_OS_WINDOWS)
#else
return (uintptr_t)fWindow;
#endif
return 0;
}

void titleChanged(const char* const title) override
{
d_stdout("visibilityChanged %s", title);


Loading…
Cancel
Save