From b19da2fdde437f3a107fa3d82efcd3c8e10ca98a Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 24 Aug 2021 08:59:51 +0100 Subject: [PATCH] Allow DISTRHO_UI_USER_RESIZABLE for external UIs Signed-off-by: falkTX --- distrho/src/DistrhoUI.cpp | 6 +++++- distrho/src/DistrhoUIPrivateData.hpp | 1 + examples/EmbedExternalUI/DistrhoPluginInfo.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp index 12cce07c..9bdb9908 100644 --- a/distrho/src/DistrhoUI.cpp +++ b/distrho/src/DistrhoUI.cpp @@ -90,7 +90,11 @@ UI::~UI() bool UI::isResizable() const noexcept { #if DISTRHO_UI_USER_RESIZABLE +# if DISTRHO_PLUGIN_HAS_EXTERNAL_UI + return true; +# else return uiData->window->isResizable(); +# endif #else return false; #endif @@ -172,7 +176,7 @@ uintptr_t UI::getNextWindowId() noexcept return g_nextWindowId; } # endif -#endif +#endif // DISTRHO_PLUGIN_HAS_EXTERNAL_UI /* ------------------------------------------------------------------------------------------------------------ * DSP/Plugin Callbacks (optional) */ diff --git a/distrho/src/DistrhoUIPrivateData.hpp b/distrho/src/DistrhoUIPrivateData.hpp index 001d7ea5..8ddced26 100644 --- a/distrho/src/DistrhoUIPrivateData.hpp +++ b/distrho/src/DistrhoUIPrivateData.hpp @@ -142,6 +142,7 @@ public: void close() { ui->close(); } void focus() { ui->focus(); } void show() { ui->show(); } + bool isResizable() const noexcept { return ui->isResizable(); } bool isVisible() const noexcept { return ui->isVisible(); } void setTitle(const char* const title) { ui->setTitle(title); } void setVisible(const bool visible) { ui->setVisible(visible); } diff --git a/examples/EmbedExternalUI/DistrhoPluginInfo.h b/examples/EmbedExternalUI/DistrhoPluginInfo.h index 9c127519..cae5e2c2 100644 --- a/examples/EmbedExternalUI/DistrhoPluginInfo.h +++ b/examples/EmbedExternalUI/DistrhoPluginInfo.h @@ -27,6 +27,7 @@ #define DISTRHO_PLUGIN_IS_RT_SAFE 1 #define DISTRHO_PLUGIN_NUM_INPUTS 2 #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 +#define DISTRHO_UI_USER_RESIZABLE 1 enum Parameters { kParameterLevel = 0,