Signed-off-by: falkTX <falktx@falktx.com>tags/v2.4.0
@@ -43,18 +43,16 @@ | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
#ifdef USING_JUCE | |||||
static void carla_standalone_juce_init(void); | static void carla_standalone_juce_init(void); | ||||
static void carla_standalone_juce_idle(void); | static void carla_standalone_juce_idle(void); | ||||
static void carla_standalone_juce_cleanup(void); | static void carla_standalone_juce_cleanup(void); | ||||
# define carla_juce_init carla_standalone_juce_init | |||||
# define carla_juce_idle carla_standalone_juce_idle | |||||
# define carla_juce_cleanup carla_standalone_juce_cleanup | |||||
# include "utils/JUCE.cpp" | |||||
# undef carla_juce_init | |||||
# undef carla_juce_idle | |||||
# undef carla_juce_cleanup | |||||
#endif | |||||
#define carla_juce_init carla_standalone_juce_init | |||||
#define carla_juce_idle carla_standalone_juce_idle | |||||
#define carla_juce_cleanup carla_standalone_juce_cleanup | |||||
#include "utils/JUCE.cpp" | |||||
#undef carla_juce_init | |||||
#undef carla_juce_idle | |||||
#undef carla_juce_cleanup | |||||
// ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
// Always return a valid string ptr for standalone functions | // Always return a valid string ptr for standalone functions | ||||
@@ -2375,6 +2373,7 @@ const char* carla_get_host_osc_url_udp(CarlaHostHandle handle) | |||||
# include "CarlaProcessUtils.cpp" | # include "CarlaProcessUtils.cpp" | ||||
# include "CarlaStateUtils.cpp" | # include "CarlaStateUtils.cpp" | ||||
# include "utils/Information.cpp" | # include "utils/Information.cpp" | ||||
# include "utils/Windows.cpp" | |||||
#endif /* CARLA_PLUGIN_EXPORT */ | #endif /* CARLA_PLUGIN_EXPORT */ | ||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- |
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* Carla Plugin Host | * Carla Plugin Host | ||||
* Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -304,7 +304,10 @@ CARLA_EXPORT void carla_set_process_name(const char* name); | |||||
/* -------------------------------------------------------------------------------------------------------------------- | /* -------------------------------------------------------------------------------------------------------------------- | ||||
* window control */ | * window control */ | ||||
CARLA_EXPORT double carla_get_desktop_scale_factor(); | |||||
/*! | |||||
* Get the global/desktop scale factor. | |||||
*/ | |||||
CARLA_EXPORT double carla_get_desktop_scale_factor(void); | |||||
CARLA_EXPORT int carla_cocoa_get_window(void* nsViewPtr); | CARLA_EXPORT int carla_cocoa_get_window(void* nsViewPtr); | ||||
CARLA_EXPORT void carla_cocoa_set_transient_window_for(void* nsViewChild, void* nsViewParent); | CARLA_EXPORT void carla_cocoa_set_transient_window_for(void* nsViewChild, void* nsViewParent); | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* Carla Plugin Host | * Carla Plugin Host | ||||
* Copyright (C) 2011-2020 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -45,6 +45,10 @@ | |||||
# pragma GCC diagnostic pop | # pragma GCC diagnostic pop | ||||
#endif | #endif | ||||
#ifdef CARLA_OS_MAC | |||||
# import <AppKit/AppKit.h> | |||||
#endif | |||||
#include "water/files/File.h" | #include "water/files/File.h" | ||||
// ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* Carla Plugin Host | * Carla Plugin Host | ||||
* Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -40,13 +40,15 @@ double carla_get_desktop_scale_factor() | |||||
if (const char* const scale = getenv("QT_SCALE_FACTOR")) | if (const char* const scale = getenv("QT_SCALE_FACTOR")) | ||||
return std::max(1.0, std::atof(scale)); | return std::max(1.0, std::atof(scale)); | ||||
#if defined(CARLA_OS_MAC) && !defined(CARLA_PLUGIN_EXPORT) | |||||
#ifdef CARLA_OS_MAC | |||||
return [NSScreen mainScreen].backingScaleFactor; | return [NSScreen mainScreen].backingScaleFactor; | ||||
#endif | #endif | ||||
return 1.0; | return 1.0; | ||||
} | } | ||||
// ------------------------------------------------------------------------------------------------------------------- | |||||
int carla_cocoa_get_window(void* nsViewPtr) | int carla_cocoa_get_window(void* nsViewPtr) | ||||
{ | { | ||||
CARLA_SAFE_ASSERT_RETURN(nsViewPtr != nullptr, 0); | CARLA_SAFE_ASSERT_RETURN(nsViewPtr != nullptr, 0); | ||||
@@ -21,6 +21,7 @@ | |||||
#include "CarlaEngine.hpp" | #include "CarlaEngine.hpp" | ||||
#include "CarlaHost.h" | #include "CarlaHost.h" | ||||
#include "CarlaUtils.h" | |||||
#include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
#include "CarlaJuceUtils.hpp" | #include "CarlaJuceUtils.hpp" | ||||
@@ -657,6 +658,17 @@ int main(int argc, char* argv[]) | |||||
return 1; | return 1; | ||||
} | } | ||||
if (! useBridge && ! testing) | |||||
{ | |||||
#ifdef HAVE_X11 | |||||
if (std::getenv("DISPLAY") != nullptr) | |||||
#endif | |||||
carla_set_engine_option(gHostHandle, | |||||
CarlaBackend::ENGINE_OPTION_FRONTEND_UI_SCALE, | |||||
static_cast<int>(carla_get_desktop_scale_factor()*1000+0.5), | |||||
nullptr); | |||||
} | |||||
// ----------------------------------------------------------------- | // ----------------------------------------------------------------- | ||||
// Init plugin | // Init plugin | ||||