From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56360 --- dlls/user32/sysparams.c | 11 +++++++++-- dlls/user32/tests/sysparams.c | 12 ++++++------ 2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index d30bed44b31..9fa37a292d1 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -636,13 +636,20 @@ BOOL WINAPI SetProcessDpiAwarenessInternal( DPI_AWARENESS awareness ) return SetProcessDpiAwarenessContext( contexts[awareness] ); }
+static ULONG_PTR map_awareness_context( DPI_AWARENESS_CONTEXT ctx ) +{ + if (ctx == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 || ctx == (DPI_AWARENESS_CONTEXT)0x22 || ctx == (DPI_AWARENESS_CONTEXT)0x80000022) + return 0x22; + return GetAwarenessFromDpiAwarenessContext(ctx); +} + /*********************************************************************** * AreDpiAwarenessContextsEqual (USER32.@) */ BOOL WINAPI AreDpiAwarenessContextsEqual( DPI_AWARENESS_CONTEXT ctx1, DPI_AWARENESS_CONTEXT ctx2 ) { - DPI_AWARENESS aware1 = GetAwarenessFromDpiAwarenessContext( ctx1 ); - DPI_AWARENESS aware2 = GetAwarenessFromDpiAwarenessContext( ctx2 ); + DPI_AWARENESS aware1 = map_awareness_context( ctx1 ); + DPI_AWARENESS aware2 = map_awareness_context( ctx2 ); return aware1 != DPI_AWARENESS_INVALID && aware1 == aware2; }
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 3b8613160dc..9a1d7928a27 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -3852,16 +3852,16 @@ static void test_AreDpiAwarenessContextsEqual(ULONG_PTR flags) } tests[ARRAY_SIZE(contexts)][ARRAY_SIZE(contexts)] = { { { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 } }, { { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 } }, - { { 0 }, { 0 }, { 1 }, { 0, TRUE }, { 0 }, { 0 }, { 1 }, { 0, TRUE }, { 0 }, { 0 }, { 1 }, { 0, TRUE } }, - { { 0 }, { 0 }, { 0, TRUE }, { 1 }, { 0 }, { 0 }, { 0, TRUE }, { 1 }, { 0 }, { 0 }, { 0, TRUE }, { 1 } }, + { { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 } }, + { { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 } }, { { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 } }, { { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 } }, - { { 0 }, { 0 }, { 1 }, { 0, TRUE }, { 0 }, { 0 }, { 1 }, { 0, TRUE }, { 0 }, { 0 }, { 1 }, { 0, TRUE } }, - { { 0 }, { 0 }, { 0, TRUE }, { 1 }, { 0 }, { 0 }, { 0, TRUE }, { 1 }, { 0 }, { 0 }, { 0, TRUE }, { 1 } }, + { { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 } }, + { { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 } }, { { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 } }, { { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 } }, - { { 0 }, { 0 }, { 1 }, { 0, TRUE }, { 0 }, { 0 }, { 1 }, { 0, TRUE }, { 0 }, { 0 }, { 1 }, { 0, TRUE } }, - { { 0 }, { 0 }, { 0 , TRUE}, { 1 }, { 0 }, { 0 }, { 0, TRUE }, { 1 }, { 0 }, { 0 }, { 0, TRUE }, { 1 } }, + { { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 } }, + { { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 }, { 0 }, { 0 }, { 0 }, { 1 } }, };
for (i = 0; i < ARRAY_SIZE(contexts); i++)