Zhiyi Zhang : uxtheme/tests: Avoid fix blurry apps popup in test_GetThemePartSize().

Alexandre Julliard julliard at winehq.org
Mon Jan 10 15:59:11 CST 2022


Module: wine
Branch: master
Commit: 05d3480f875c8953260c9b07e826d5e9aafbee30
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=05d3480f875c8953260c9b07e826d5e9aafbee30

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Mon Jan 10 15:38:29 2022 +0800

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);
 }
 




More information about the wine-cvs mailing list