From 32d29e39f699815de47c98018a72a0906763f52a Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sun, 6 Nov 2022 16:04:34 +0800 Subject: [PATCH] win: use same code style Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- src/core/utils_win.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index 0942255..3ee4c45 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -2378,13 +2378,12 @@ DpiAwareness Utils::getDpiAwarenessForCurrentProcess(bool *highest) } if (API_USER_AVAILABLE(IsProcessDPIAware)) { const BOOL isAware = API_CALL_FUNCTION(IsProcessDPIAware); + static constexpr const auto highestAvailable = DpiAwareness::System; + const auto result = ((isAware == FALSE) ? DpiAwareness::Unaware : DpiAwareness::System); if (highest) { - *highest = (isAware != FALSE); + *highest = (result == highestAvailable); } - if (isAware) { - return DpiAwareness::System; - } - return DpiAwareness::Unaware; + return result; } return DpiAwareness::Unknown; }