1
0
mirror of synced 2025-01-18 17:14:13 +01:00

fix: Building on macOS

This commit is contained in:
WerWolv 2023-02-08 13:51:56 +01:00
parent 235a64deef
commit dd87dc7046
3 changed files with 12 additions and 8 deletions

View File

@ -2,9 +2,12 @@
#if defined(OS_MACOS)
#include <string>
extern "C" {
extern "C" void openWebpageMacos(const char *url);
extern "C" bool isMacosSystemDarkModeEnabled();
void openWebpageMacos(const char *url);
bool isMacosSystemDarkModeEnabled();
float getBackingScaleFactorMacos();
}
#endif

View File

@ -4,6 +4,7 @@
#include <ApplicationServices/ApplicationServices.h>
#include <Foundation/NSUserDefaults.h>
#include <Foundation/Foundation.h>
#include <AppKit/NSScreen.h>
#include <string.h>
#include <stdlib.h>
@ -25,4 +26,8 @@
}
}
float getBackingScaleFactorMacos(void) {
return [[NSScreen mainScreen] backingScaleFactor];
}
#endif

View File

@ -22,10 +22,6 @@
#include <future>
#include <numeric>
#if defined (OS_MACOS)
#include <AppKit/NSScreen.h>
#endif
using namespace std::literals::chrono_literals;
namespace hex::init {
@ -209,7 +205,7 @@ namespace hex::init {
meanScale = 1.0F;
#if defined(OS_MACOS)
meanScale /= NSScreen.mainScreen.backingScaleFactor;
meanScale /= getBackingScaleFactorMacos();
#endif
ImHexApi::System::impl::setGlobalScale(meanScale);