[PATCH 2/2] uxtheme/tests: Avoid fix blurry apps popup in test_GetThemePartSize().
When changing DPI, a fix blurry apps popup may appear on Windows 10. The popup may interfere with other tests as it steals focus, causing them to fail. So set IgnorePerProcessSystemDPIToast to 1 to temporarily disable the popup. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/uxtheme/tests/system.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index b085e639784..0385af663e3 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -997,11 +997,13 @@ todo_wine static void test_GetThemePartSize(void) { + static const DWORD enabled = 1; DPI_AWARENESS_CONTEXT old_context; unsigned int old_dpi, current_dpi; HTHEME htheme = NULL; HWND hwnd = NULL; SIZE size, size2; + HKEY key = NULL; HRESULT hr; HDC hdc; @@ -1011,6 +1013,12 @@ static void test_GetThemePartSize(void) return; } + /* Set IgnorePerProcessSystemDPIToast to 1 to disable "fix blurry apps popup" on Windows 10, + * which may interfere other tests because it steals focus */ + RegOpenKeyA(HKEY_CURRENT_USER, "Control Panel\\Desktop", &key); + RegSetValueExA(key, "IgnorePerProcessSystemDPIToast", 0, REG_DWORD, (const BYTE *)&enabled, + sizeof(enabled)); + old_context = pSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); current_dpi = get_primary_monitor_effective_dpi(); old_dpi = current_dpi; @@ -1100,6 +1108,11 @@ done: CloseThemeData(htheme); if (get_primary_monitor_effective_dpi() != old_dpi) set_primary_monitor_effective_dpi(old_dpi); + if (key) + { + RegDeleteValueA(key, "IgnorePerProcessSystemDPIToast"); + RegCloseKey(key); + } pSetThreadDpiAwarenessContext(old_context); } -- 2.32.0
participants (1)
-
Zhiyi Zhang