From 6b11028b7252dab340bea70d7b539471e2729c07 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 5 Feb 2025 13:47:38 +0100 Subject: [PATCH] impr: Use proper function to get environment variables --- lib/libimhex/source/api/imhex_api.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libimhex/source/api/imhex_api.cpp b/lib/libimhex/source/api/imhex_api.cpp index 756a12fae..146aa9a52 100644 --- a/lib/libimhex/source/api/imhex_api.cpp +++ b/lib/libimhex/source/api/imhex_api.cpp @@ -638,8 +638,8 @@ namespace hex { #elif defined(OS_MACOS) return ::getBackingScaleFactor(); #elif defined(OS_LINUX) - const auto sessionType = ::getenv("XDG_SESSION_TYPE"); - if (sessionType == nullptr || std::string_view(sessionType) == "x11") + const auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE"); + if (!sessionType.has_value() || sessionType == "x11") return 1.0F; else { float xScale = 0, yScale = 0;