diff options
author | falkTX <falktx@gmail.com> | 2016-02-14 21:02:37 +0100 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2016-02-14 21:02:37 +0100 |
commit | 502d3359fbe230cdf9030b81228e945e5a7060d3 (patch) | |
tree | 568c1ff356b8c1a1d4e3369f846dc7416f33cad6 | |
parent | 8358893bf3f81dd6e2b6494fe87defe6bbb80947 (diff) |
Report some status of external window to host
-rw-r--r-- | distrho/src/DistrhoUIInternal.hpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/distrho/src/DistrhoUIInternal.hpp b/distrho/src/DistrhoUIInternal.hpp index d4394559..a649be93 100644 --- a/distrho/src/DistrhoUIInternal.hpp +++ b/distrho/src/DistrhoUIInternal.hpp @@ -267,7 +267,8 @@ public: #ifdef HAVE_DGL return glWindow.isVisible(); #else - return true; + DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr, false); + return fUI->isRunning(); #endif } @@ -338,27 +339,38 @@ public: if (glWindow.isReady()) fUI->uiIdle(); } +#endif bool idle() { DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr, false); +#ifdef HAVE_DGL glApp.idle(); if (glWindow.isReady()) fUI->uiIdle(); return ! glApp.isQuiting(); +#else + return fUI->isRunning(); +#endif } void quit() { +#ifdef HAVE_DGL glWindow.close(); glApp.quit(); +#else + DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,); + fUI->terminateAndWaitForProcess(); +#endif } // ------------------------------------------------------------------- +#ifdef HAVE_DGL void setWindowSize(const uint width, const uint height, const bool updateUI = false) { DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,); @@ -391,8 +403,6 @@ public: return ! glApp.isQuiting(); } #else - bool idle() { return true; } - void quit() {} void setWindowSize(const uint width, const uint height, const bool updateUI = false) {} void setWindowTitle(const char* const uiTitle) {} void setWindowTransientWinId(const uintptr_t winId) {} |