commit 12bf589be943cc0a3eecdc4ab40bb5fee6499e6f
parent af38050160d2cca8ee703d51383f4cc55b7e26bd
Author: falkTX <falktx@falktx.com>
Date: Sat, 10 Sep 2022 11:52:35 +0100
Deal with plugin-initiated UI resize for CLAP
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dgl/Window.hpp b/dgl/Window.hpp
@@ -541,7 +541,7 @@ private:
uint height,
double scaleFactor,
bool resizable,
- bool isVST3,
+ bool usesSizeRequest,
bool doPostInit);
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window)
diff --git a/dgl/src/WindowPrivateData.cpp b/dgl/src/WindowPrivateData.cpp
@@ -184,7 +184,7 @@ Window::PrivateData::PrivateData(Application& a, Window* const s,
Window::PrivateData::PrivateData(Application& a, Window* const s,
const uintptr_t parentWindowHandle,
const uint width, const uint height,
- const double scale, const bool resizable, const bool isVST3)
+ const double scale, const bool resizable, const bool usesSizeRequest_)
: app(a),
appData(a.pData),
self(s),
@@ -193,7 +193,7 @@ Window::PrivateData::PrivateData(Application& a, Window* const s,
isClosed(parentWindowHandle == 0),
isVisible(parentWindowHandle != 0 && view != nullptr),
isEmbed(parentWindowHandle != 0),
- usesSizeRequest(isVST3),
+ usesSizeRequest(usesSizeRequest_),
scaleFactor(scale != 0.0 ? scale : getScaleFactorFromParent(view)),
autoScaling(false),
autoScaleFactor(1.0),
diff --git a/distrho/src/DistrhoUIPrivateData.hpp b/distrho/src/DistrhoUIPrivateData.hpp
@@ -38,10 +38,10 @@
# define DISTRHO_UI_IS_STANDALONE 0
#endif
-#ifdef DISTRHO_PLUGIN_TARGET_VST3
-# define DISTRHO_UI_IS_VST3 1
+#if defined(DISTRHO_PLUGIN_TARGET_VST3) || defined(DISTRHO_PLUGIN_TARGET_CLAP)
+# define DISTRHO_UI_USES_SIZE_REQUEST true
#else
-# define DISTRHO_UI_IS_VST3 0
+# define DISTRHO_UI_USES_SIZE_REQUEST false
#endif
#ifdef DISTRHO_PLUGIN_TARGET_VST2
@@ -183,7 +183,7 @@ public:
const uint height,
const double scaleFactor)
: Window(app, parentWindowHandle, width, height, scaleFactor,
- DISTRHO_UI_USER_RESIZABLE, DISTRHO_UI_IS_VST3, false),
+ DISTRHO_UI_USER_RESIZABLE, DISTRHO_UI_USES_SIZE_REQUEST, false),
ui(uiPtr),
initializing(true),
receivedReshapeDuringInit(false)