Browse Source

Deal with plugin-initiated UI resize for CLAP

Signed-off-by: falkTX <falktx@falktx.com>
pull/321/merge
falkTX 2 years ago
parent
commit
12bf589be9
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 7 additions and 7 deletions
  1. +1
    -1
      dgl/Window.hpp
  2. +2
    -2
      dgl/src/WindowPrivateData.cpp
  3. +4
    -4
      distrho/src/DistrhoUIPrivateData.hpp

+ 1
- 1
dgl/Window.hpp View File

@@ -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)


+ 2
- 2
dgl/src/WindowPrivateData.cpp View File

@@ -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),


+ 4
- 4
distrho/src/DistrhoUIPrivateData.hpp View File

@@ -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)


Loading…
Cancel
Save