From 9ed9c40046945ad775501fec9856fbf0bff23482 Mon Sep 17 00:00:00 2001 From: Filtik Date: Sun, 7 Apr 2024 22:39:47 +0200 Subject: [PATCH 1/3] fix Win7/8 resolution --- Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp index e71f26d1c7..62d975d979 100644 --- a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp +++ b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp @@ -160,7 +160,7 @@ UINT plWinDpi::GetDpi(HWND hWnd) const auto dpiForMonitor = fGetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY); if (dpiForMonitor.has_value()) { if (SUCCEEDED(dpiForMonitor.value())) - return UINT(float(dpiY) / 96.0f); + return UINT(float(dpiY)); LogRed("Per-Monitor DPI failed: {}", hsCOMError(dpiForMonitor.value())); } @@ -168,7 +168,7 @@ UINT plWinDpi::GetDpi(HWND hWnd) const HDC hdc = GetDC(hWnd); int ydpi = GetDeviceCaps(hdc, LOGPIXELSY); ReleaseDC(hWnd, hdc); - return UINT(float(ydpi) / 96.0f); + return UINT(float(ydpi)); } int plWinDpi::GetSystemMetrics(int nIndex, std::variant dpiArg) const From e7b7e6bba89868220d53e356222a2f90d33ac4a6 Mon Sep 17 00:00:00 2001 From: Filtik <1388865+Filtik@users.noreply.github.com> Date: Mon, 8 Apr 2024 21:49:13 +0200 Subject: [PATCH 2/3] Update Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp index 62d975d979..35c290fe6a 100644 --- a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp +++ b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp @@ -160,7 +160,7 @@ UINT plWinDpi::GetDpi(HWND hWnd) const auto dpiForMonitor = fGetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY); if (dpiForMonitor.has_value()) { if (SUCCEEDED(dpiForMonitor.value())) - return UINT(float(dpiY)); + return dpiY; LogRed("Per-Monitor DPI failed: {}", hsCOMError(dpiForMonitor.value())); } From 12d51af1be1a298dcc62da5daebe52a47bca9385 Mon Sep 17 00:00:00 2001 From: Filtik <1388865+Filtik@users.noreply.github.com> Date: Mon, 8 Apr 2024 21:49:23 +0200 Subject: [PATCH 3/3] Update Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp index 35c290fe6a..0c8cb91555 100644 --- a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp +++ b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.cpp @@ -168,7 +168,7 @@ UINT plWinDpi::GetDpi(HWND hWnd) const HDC hdc = GetDC(hWnd); int ydpi = GetDeviceCaps(hdc, LOGPIXELSY); ReleaseDC(hWnd, hdc); - return UINT(float(ydpi)); + return UINT(ydpi); } int plWinDpi::GetSystemMetrics(int nIndex, std::variant dpiArg) const