fix: don't use DPI aware functions on Qt 5 (Windows 7/8) (#5391)
This commit is contained in:
@@ -121,12 +121,19 @@ RECT windowBordersFor(HWND hwnd, bool isMaximized)
|
||||
auto addBorders = isMaximized || isWindows11OrGreater();
|
||||
if (addBorders)
|
||||
{
|
||||
// GetDpiForWindow and GetSystemMetricsForDpi are only supported on
|
||||
// Windows 10 and later. Qt 6 requires Windows 10.
|
||||
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
auto dpi = GetDpiForWindow(hwnd);
|
||||
# endif
|
||||
|
||||
auto systemMetric = [&](auto index) {
|
||||
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
if (dpi != 0)
|
||||
{
|
||||
return GetSystemMetricsForDpi(index, dpi);
|
||||
}
|
||||
# endif
|
||||
return GetSystemMetrics(index);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user