Zhiyi Zhang : user32/tests: Avoid fix blurry apps popup in test_DisplayConfigSetDeviceInfo().

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


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

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

user32/tests: Avoid fix blurry apps popup in test_DisplayConfigSetDeviceInfo().

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.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52108
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/monitor.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index a857b295849..5e14c536a76 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -1958,12 +1958,14 @@ static void test_display_config(void)
 static void test_DisplayConfigSetDeviceInfo(void)
 {
     static const unsigned int scales[] = {100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500};
+    static const DWORD enabled = 1;
     int current_scale, current_scale_idx, recommended_scale_idx, step, dpi, old_dpi;
     D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME open_adapter_gdi_desc;
     DISPLAYCONFIG_GET_SOURCE_DPI_SCALE get_scale_req;
     DISPLAYCONFIG_SET_SOURCE_DPI_SCALE set_scale_req;
     D3DKMT_CLOSEADAPTER close_adapter_desc;
     NTSTATUS status;
+    HKEY key;
     LONG ret;
 
 #define CHECK_FUNC(func)                       \
@@ -1997,6 +1999,12 @@ static void test_DisplayConfigSetDeviceInfo(void)
         goto failed;
     }
 
+    /* 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));
+
     dpi = get_primary_dpi();
     old_dpi = dpi;
     current_scale = dpi * 100 / 96;
@@ -2028,6 +2036,10 @@ static void test_DisplayConfigSetDeviceInfo(void)
     ok(ret == NO_ERROR, "DisplayConfigSetDeviceInfo failed, returned %d.\n", ret);
     ok(old_dpi == get_primary_dpi(), "Expected %d, got %d.\n", get_primary_dpi(), old_dpi);
 
+    /* Remove IgnorePerProcessSystemDPIToast registry value */
+    RegDeleteValueA(key, "IgnorePerProcessSystemDPIToast");
+    RegCloseKey(key);
+
 failed:
     close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
     status = pD3DKMTCloseAdapter(&close_adapter_desc);




More information about the wine-cvs mailing list