sys: One more attempt to fix macOS scaling issues
This commit is contained in:
parent
89a96c6d25
commit
235a64deef
@ -22,6 +22,10 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
|
#if defined (OS_MACOS)
|
||||||
|
#include <AppKit/NSScreen.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std::literals::chrono_literals;
|
using namespace std::literals::chrono_literals;
|
||||||
|
|
||||||
namespace hex::init {
|
namespace hex::init {
|
||||||
@ -205,7 +209,7 @@ namespace hex::init {
|
|||||||
meanScale = 1.0F;
|
meanScale = 1.0F;
|
||||||
|
|
||||||
#if defined(OS_MACOS)
|
#if defined(OS_MACOS)
|
||||||
meanScale = std::max(meanScale / 2.0F, 1.0F);
|
meanScale /= NSScreen.mainScreen.backingScaleFactor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ImHexApi::System::impl::setGlobalScale(meanScale);
|
ImHexApi::System::impl::setGlobalScale(meanScale);
|
||||||
|
@ -726,7 +726,8 @@ namespace hex {
|
|||||||
|
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_NavEnableKeyboard;
|
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_NavEnableKeyboard;
|
||||||
io.ConfigWindowsMoveFromTitleBarOnly = true;
|
io.ConfigWindowsMoveFromTitleBarOnly = true;
|
||||||
io.FontGlobalScale = 1.0F;
|
|
||||||
|
io.FontGlobalScale = ImHexApi::System::getGlobalScale();
|
||||||
|
|
||||||
if (glfwGetPrimaryMonitor() != nullptr) {
|
if (glfwGetPrimaryMonitor() != nullptr) {
|
||||||
auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE");
|
auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE");
|
||||||
|
Loading…
Reference in New Issue
Block a user