Alexandre Julliard : user32: Also ignore dynamic DPI awareness changes when DPI scaling is disabled.

Alexandre Julliard julliard at winehq.org
Mon Dec 31 11:16:56 CST 2018


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 31 16:45:06 2018 +0100

user32: Also ignore dynamic DPI awareness changes when DPI scaling is disabled.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/sysparams.c       |  2 +-
 dlls/user32/tests/sysparams.c | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 224d2f9..70dce3f 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -1463,7 +1463,7 @@ void SYSPARAMS_Init(void)
     if (!dpi_scaling)
     {
         default_awareness = DPI_AWARENESS_PER_MONITOR_AWARE;
-        if (dpi_awareness) dpi_awareness = 0x10 | default_awareness;
+        dpi_awareness = 0x10 | default_awareness;
     }
 
     if (volatile_base_key && dispos == REG_CREATED_NEW_KEY)  /* first process, initialize entries */
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index c50acbe..f74c9e7 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -3567,6 +3567,7 @@ static void test_dpi_context(void)
     ok( !ret, "got %d\n", ret );
     ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
     ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
+    todo_wine
     ok( ret, "got %d\n", ret );
     ok( pIsProcessDPIAware(), "not aware\n" );
     real_dpi = pGetDpiForSystem();
@@ -3587,9 +3588,11 @@ static void test_dpi_context(void)
     ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
     ret = pGetProcessDpiAwarenessInternal( 0, &awareness );
     ok( ret, "got %d\n", ret );
+    todo_wine
     ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
     ret = pGetProcessDpiAwarenessInternal( GetCurrentProcess(), &awareness );
     ok( ret, "got %d\n", ret );
+    todo_wine
     ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
     ret = pGetProcessDpiAwarenessInternal( (HANDLE)0xdeadbeef, &awareness );
     ok( ret, "got %d\n", ret );
@@ -3598,8 +3601,10 @@ static void test_dpi_context(void)
     ret = pIsProcessDPIAware();
     ok(ret, "got %d\n", ret);
     context = pGetThreadDpiAwarenessContext();
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
     awareness = pGetAwarenessFromDpiAwarenessContext( context );
+    todo_wine
     ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
     SetLastError( 0xdeadbeef );
     context = pSetThreadDpiAwarenessContext( 0 );
@@ -3610,8 +3615,10 @@ static void test_dpi_context(void)
     ok( !context, "got %p\n", context );
     ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
     context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
     awareness = pGetAwarenessFromDpiAwarenessContext( context );
+    todo_wine
     ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
     dpi = pGetDpiForSystem();
     ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
@@ -3648,16 +3655,21 @@ static void test_dpi_context(void)
     context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000010 | flags) );
     ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
     context = pGetThreadDpiAwarenessContext();
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
     context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000011 | flags) );
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
     context = pGetThreadDpiAwarenessContext();
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
     context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x12 );
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
     context = pSetThreadDpiAwarenessContext( context );
     ok( context == (DPI_AWARENESS_CONTEXT)(0x12), "wrong context %p\n", context );
     context = pGetThreadDpiAwarenessContext();
+    todo_wine
     ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
     for (i = 0; i < 0x100; i++)
     {




More information about the wine-cvs mailing list