1
0
mirror of synced 2024-11-24 15:50:16 +01:00

sys: One more attempt to fix macOS scaling issues

This commit is contained in:
WerWolv 2023-02-08 12:53:34 +01:00
parent 89a96c6d25
commit 235a64deef
2 changed files with 7 additions and 2 deletions

View File

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

View File

@ -726,7 +726,8 @@ namespace hex {
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_NavEnableKeyboard;
io.ConfigWindowsMoveFromTitleBarOnly = true;
io.FontGlobalScale = 1.0F;
io.FontGlobalScale = ImHexApi::System::getGlobalScale();
if (glfwGetPrimaryMonitor() != nullptr) {
auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE");