summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscontext.h
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2021-06-25 13:14:13 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-08-06 13:02:44 +0200
commitf9883865606b7b31396f673fd07a163d911c61f5 (patch)
treec657feec13012865628dc6f31149c000f6cf411d /src/plugins/platforms/windows/qwindowscontext.h
parent7d7b484429f2a8a23b0d15e5fbfca18f6553b1bf (diff)
Track current window DPI
The WM_DPICHANGED event gives us the new DPI, but we also need the current DPI in order to determine the scale factor corresponding to the DPI change. Pick-to: 6.2 Change-Id: Ia61388415f57aa739397d3125b8751952e8fd392 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.h')
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 99b4bb6c77..04328a0369 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -108,6 +108,7 @@ struct QWindowsUser32DLL
typedef int (WINAPI *GetWindowDpiAwarenessContext)(HWND);
typedef int (WINAPI *GetAwarenessFromDpiAwarenessContext)(int);
typedef BOOL (WINAPI *SystemParametersInfoForDpi)(UINT, UINT, PVOID, UINT, UINT);
+ typedef int (WINAPI *GetDpiForWindow)(HWND);
// Windows pointer functions (Windows 8 or later).
EnableMouseInPointer enableMouseInPointer = nullptr;
@@ -124,6 +125,9 @@ struct QWindowsUser32DLL
// Windows Vista onwards
SetProcessDPIAware setProcessDPIAware = nullptr;
+ // Windows 10 version 1607 onwards
+ GetDpiForWindow getDpiForWindow = nullptr;
+
// Windows 10 version 1703 onwards
SetProcessDpiAwarenessContext setProcessDpiAwarenessContext = nullptr;