Commit d3ca7db4 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 1bf418f0
...@@ -1463,7 +1463,7 @@ void SYSPARAMS_Init(void) ...@@ -1463,7 +1463,7 @@ void SYSPARAMS_Init(void)
if (!dpi_scaling) if (!dpi_scaling)
{ {
default_awareness = DPI_AWARENESS_PER_MONITOR_AWARE; 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 */ if (volatile_base_key && dispos == REG_CREATED_NEW_KEY) /* first process, initialize entries */
......
...@@ -3567,6 +3567,7 @@ static void test_dpi_context(void) ...@@ -3567,6 +3567,7 @@ static void test_dpi_context(void)
ok( !ret, "got %d\n", ret ); ok( !ret, "got %d\n", ret );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ); ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
todo_wine
ok( ret, "got %d\n", ret ); ok( ret, "got %d\n", ret );
ok( pIsProcessDPIAware(), "not aware\n" ); ok( pIsProcessDPIAware(), "not aware\n" );
real_dpi = pGetDpiForSystem(); real_dpi = pGetDpiForSystem();
...@@ -3587,9 +3588,11 @@ static void test_dpi_context(void) ...@@ -3587,9 +3588,11 @@ static void test_dpi_context(void)
ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
ret = pGetProcessDpiAwarenessInternal( 0, &awareness ); ret = pGetProcessDpiAwarenessInternal( 0, &awareness );
ok( ret, "got %d\n", ret ); ok( ret, "got %d\n", ret );
todo_wine
ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness ); ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
ret = pGetProcessDpiAwarenessInternal( GetCurrentProcess(), &awareness ); ret = pGetProcessDpiAwarenessInternal( GetCurrentProcess(), &awareness );
ok( ret, "got %d\n", ret ); ok( ret, "got %d\n", ret );
todo_wine
ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness ); ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
ret = pGetProcessDpiAwarenessInternal( (HANDLE)0xdeadbeef, &awareness ); ret = pGetProcessDpiAwarenessInternal( (HANDLE)0xdeadbeef, &awareness );
ok( ret, "got %d\n", ret ); ok( ret, "got %d\n", ret );
...@@ -3598,8 +3601,10 @@ static void test_dpi_context(void) ...@@ -3598,8 +3601,10 @@ static void test_dpi_context(void)
ret = pIsProcessDPIAware(); ret = pIsProcessDPIAware();
ok(ret, "got %d\n", ret); ok(ret, "got %d\n", ret);
context = pGetThreadDpiAwarenessContext(); context = pGetThreadDpiAwarenessContext();
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
awareness = pGetAwarenessFromDpiAwarenessContext( context ); awareness = pGetAwarenessFromDpiAwarenessContext( context );
todo_wine
ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness ); ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
context = pSetThreadDpiAwarenessContext( 0 ); context = pSetThreadDpiAwarenessContext( 0 );
...@@ -3610,8 +3615,10 @@ static void test_dpi_context(void) ...@@ -3610,8 +3615,10 @@ static void test_dpi_context(void)
ok( !context, "got %p\n", context ); ok( !context, "got %p\n", context );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE ); context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
awareness = pGetAwarenessFromDpiAwarenessContext( context ); awareness = pGetAwarenessFromDpiAwarenessContext( context );
todo_wine
ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness ); ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
dpi = pGetDpiForSystem(); dpi = pGetDpiForSystem();
ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi ); ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
...@@ -3648,16 +3655,21 @@ static void test_dpi_context(void) ...@@ -3648,16 +3655,21 @@ static void test_dpi_context(void)
context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000010 | flags) ); context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000010 | flags) );
ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
context = pGetThreadDpiAwarenessContext(); context = pGetThreadDpiAwarenessContext();
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000011 | flags) ); context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000011 | flags) );
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
context = pGetThreadDpiAwarenessContext(); context = pGetThreadDpiAwarenessContext();
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x12 ); context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x12 );
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
context = pSetThreadDpiAwarenessContext( context ); context = pSetThreadDpiAwarenessContext( context );
ok( context == (DPI_AWARENESS_CONTEXT)(0x12), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x12), "wrong context %p\n", context );
context = pGetThreadDpiAwarenessContext(); context = pGetThreadDpiAwarenessContext();
todo_wine
ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
for (i = 0; i < 0x100; i++) for (i = 0; i < 0x100; i++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment