From a29d15fc52fa9f6a4e48d5aa958291a09e347de2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Jan 2019 06:06:31 +0100 Subject: [PATCH] Some fixes for windows Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginJuce.cpp | 2 +- source/bridges-plugin/CarlaBridgePlugin.cpp | 2 ++ source/utils/JucePluginWindow.hpp | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/backend/plugin/CarlaPluginJuce.cpp b/source/backend/plugin/CarlaPluginJuce.cpp index 1e616a936..6a42b4b61 100644 --- a/source/backend/plugin/CarlaPluginJuce.cpp +++ b/source/backend/plugin/CarlaPluginJuce.cpp @@ -1232,7 +1232,7 @@ public: else pData->name = pData->engine->getUniquePluginName(fInstance->getName().toRawUTF8()); - if (filename != nullptr && pData->filename[0] != '\0') + if (filename != nullptr && filename[0] != '\0') pData->filename = carla_strdup(filename); // --------------------------------------------------------------- diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index 7d8976f0c..a7c7c1dc4 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -251,8 +251,10 @@ public: gIsInitiated = true; #if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) +# ifndef CARLA_OS_WIN static const int argc = 0; static const char* argv[] = {}; +# endif juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; juce::JUCEApplicationBase::main(JUCE_MAIN_FUNCTION_ARGS); #else diff --git a/source/utils/JucePluginWindow.hpp b/source/utils/JucePluginWindow.hpp index fef0d5f8a..b231f620c 100644 --- a/source/utils/JucePluginWindow.hpp +++ b/source/utils/JucePluginWindow.hpp @@ -125,6 +125,13 @@ private: [parentWindow addChildWindow:window ordered:NSWindowAbove]; #endif + +#if JUCE_WINDOWS + const HWND window = (HWND)getWindowHandle(); + CARLA_SAFE_ASSERT_RETURN(window != nullptr,); + + SetWindowLongPtr(window, GWLP_HWNDPARENT, static_cast(fTransientId)); +#endif } CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JucePluginWindow)