From 4a2c31103c7c993c87f88087811e02804adfabf3 Mon Sep 17 00:00:00 2001 From: Vladimir Belyavsky Date: Fri, 20 May 2022 19:38:06 +0300 Subject: Fallback to PerMonitorDpiAware if V2DpiAware is not supported by system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 might not be supported on some legacy Windows 10 editions (prior Creator Update). In this case SetProcessDpiAwarenessContext returns ERROR_INVALID_PARAMETER. Fallback to DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE using old API SetProcessDpiAwareness in such cases as the most suitable. Fixes: QTBUG-103733 Pick-to: 6.3 6.4 Change-Id: I39216e63ecfcae96aaa159237a52b0a76bc5d956 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/windows/qwindowscontext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowscontext.h') diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index ac65f745e7..4cc47a3ba4 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -121,7 +121,7 @@ public: static void setTabletAbsoluteRange(int a); void setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness); static int processDpiAwareness(); - void setProcessDpiV2Awareness(); + bool setProcessDpiV2Awareness(); static bool isDarkMode(); -- cgit v1.2.3