From d3ca7db42e207e4f646865c39f47c987a8ac161a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 31 Dec 2018 16:45:06 +0100 Subject: [PATCH] user32: Also ignore dynamic DPI awareness changes when DPI scaling is disabled. Signed-off-by: Alexandre Julliard --- 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 224d2f9fe07..70dce3fdeb1 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 c50acbe5516..f74c9e75613 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++) { -- 2.11.4.GIT