From 7943e71139d9f529145f13fdbdbb49150279ade1 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 27 Feb 2024 09:22:31 +0100 Subject: [PATCH] Cleanup Signed-off-by: falkTX --- Makefile | 2 +- dpf | 2 +- plugins/Common/IldaeilUI.cpp | 19 ++++++++++++------- plugins/Standalone/DistrhoPluginInfo.h | 6 +++++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ac660b5..7d1df1e 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ gen: endif jack: carla dgl - $(MAKE) $(CARLA_EXTRA_ARGS) $(ILDAEIL_FX_ARGS) -C plugins/Standalone + $(MAKE) $(CARLA_EXTRA_ARGS) $(DGL_EXTRA_ARGS) $(ILDAEIL_FX_ARGS) -C plugins/Standalone # --------------------------------------------------------------------------------------------------------------------- diff --git a/dpf b/dpf index 11ea617..83b574e 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 11ea617b17d9daef7c4194baf997c83bf921c905 +Subproject commit 83b574eaf2ecb8f715d6cab5162d14388feb670e diff --git a/plugins/Common/IldaeilUI.cpp b/plugins/Common/IldaeilUI.cpp index 0a52da1..a8afb55 100644 --- a/plugins/Common/IldaeilUI.cpp +++ b/plugins/Common/IldaeilUI.cpp @@ -692,7 +692,7 @@ class IldaeilUI : public UI, fUpdateGeometryConstraints = true; } - #if ILDAEIL_STANDALONE + #if DISTRHO_UI_USER_RESIZABLE void onResize(const ResizeEvent& ev) override { UI::onResize(ev); @@ -701,13 +701,18 @@ class IldaeilUI : public UI, return; if (fShowingHostWindow) return; + if (fDrawingState != kDrawingPluginEmbedUI) + return; - if (fDrawingState == kDrawingPluginEmbedUI) - { - const uint extraHeight = kButtonHeight * getScaleFactor() + ImGui::GetStyle().WindowPadding.y * 2; - - fPluginHostWindow.setSize(ev.size.getWidth(), ev.size.getHeight() - extraHeight); - } + const double scaleFactor = getScaleFactor(); + const uint extraHeight = kButtonHeight * scaleFactor + ImGui::GetStyle().WindowPadding.y * 2; + uint width = ev.size.getWidth(); + uint height = ev.size.getHeight() - extraHeight; + #ifdef DISTRHO_OS_MAC + width /= scaleFactor; + height /= scaleFactor; + #endif + fPluginHostWindow.setSize(width, height); } #endif diff --git a/plugins/Standalone/DistrhoPluginInfo.h b/plugins/Standalone/DistrhoPluginInfo.h index ae36e06..8b5998a 100644 --- a/plugins/Standalone/DistrhoPluginInfo.h +++ b/plugins/Standalone/DistrhoPluginInfo.h @@ -34,7 +34,6 @@ #define DISTRHO_PLUGIN_WANT_TIMEPOS 1 #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1 #define DISTRHO_UI_USE_CUSTOM 1 -#define DISTRHO_UI_USER_RESIZABLE 1 #define DISTRHO_UI_CUSTOM_INCLUDE_PATH "DearImGui.hpp" #define DISTRHO_UI_CUSTOM_WIDGET_TYPE DGL_NAMESPACE::ImGuiTopLevelWidget #define DISTRHO_UI_DEFAULT_WIDTH kInitialWidth @@ -42,6 +41,11 @@ #define ILDAEIL_STANDALONE 1 +#ifndef __APPLE__ +// FIXME +#define DISTRHO_UI_USER_RESIZABLE 1 +#endif + static constexpr const uint kInitialWidth = 640; static constexpr const uint kInitialHeight = 480;