Zhiyi Zhang : uxtheme: Initialize system metrics in 96 DPI.

Alexandre Julliard julliard at winehq.org
Wed Sep 22 16:04:37 CDT 2021


Module: wine
Branch: master
Commit: cd99d08a74736f9267c53c63e7a5399ea133147b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cd99d08a74736f9267c53c63e7a5399ea133147b

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Wed Sep 22 10:23:38 2021 +0800

uxtheme: Initialize system metrics in 96 DPI.

Similar to 7290db3.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/uxtheme/msstyles.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c
index 7356f6ea354..f129d998d65 100644
--- a/dlls/uxtheme/msstyles.c
+++ b/dlls/uxtheme/msstyles.c
@@ -733,12 +733,18 @@ struct PARSENONCLIENTSTATE
 
 static inline void parse_init_nonclient (struct PARSENONCLIENTSTATE* state)
 {
+    DPI_AWARENESS_CONTEXT old_context;
+
+    old_context = SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE);
+
     memset (state, 0, sizeof (*state));
     state->metrics.cbSize = sizeof (NONCLIENTMETRICSW);
     SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, sizeof (NONCLIENTMETRICSW),
         &state->metrics, 0);
     SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof (LOGFONTW),
         &state->iconTitleFont, 0);
+
+    SetThreadDpiAwarenessContext(old_context);
 }
 
 static BOOL parse_handle_nonclient_font (struct PARSENONCLIENTSTATE* state, 




More information about the wine-cvs mailing list