Commit 05d3480f authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d16998e0
......@@ -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);
}
......
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