From 24b7782f3d95598365fd8127b5e96bb2e18b4c3e Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 6 Sep 2026 11:30:54 -0400 Subject: [PATCH 1/2] test(Windows): Stabilize notification display tray test Improve `TestNotificationDisplay` reliability by waiting for Explorer to register the tray icon before dismissing notifications. The test now moves the mouse over the icon, waits for the tooltip, and restores mouse position to avoid timing-related flakiness. --- tests/unit/test_tray.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/test_tray.cpp b/tests/unit/test_tray.cpp index 0a72b9b..c1ae075 100644 --- a/tests/unit/test_tray.cpp +++ b/tests/unit/test_tray.cpp @@ -401,6 +401,12 @@ TEST_P(TrayNotificationIconTest, TestNotificationDisplay) { int initResult = tray_init(&testTray); trayRunning = (initResult == 0); ASSERT_EQ(initResult, 0); + + // Explorer must process the new icon before it can display this icon's notification. + WaitForTrayReady(); + ASSERT_EQ(tray_position_mouse_over_icon(), 0); + WaitForTooltipReady(); + EXPECT_EQ(tray_restore_mouse_position(), 0); dismissNativeNotifications(); // Set notification properties From c322928b4c688fdb916c80d4fa64b294597fa7a5 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 6 Sep 2026 12:13:39 -0400 Subject: [PATCH 2/2] test(Windows): stabilize tray notification CI test Pin the CI Windows runner to `windows-2022` because `windows-latest` suppresses `QSystemTrayIcon` notifications in the interactive session. Also add a `WaitForTrayReady()` step in `TestNotificationDisplay` so the tray icon is fully registered before notification handling, reducing timing-related test flakiness. --- .../action.yml | 17 +++++++++++++++++ .github/workflows/ci.yml | 4 +++- tests/unit/test_tray.cpp | 5 +---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/actions/configure-windows-tray-screenshots/action.yml b/.github/actions/configure-windows-tray-screenshots/action.yml index 856b454..3fe2646 100644 --- a/.github/actions/configure-windows-tray-screenshots/action.yml +++ b/.github/actions/configure-windows-tray-screenshots/action.yml @@ -8,6 +8,23 @@ runs: - name: Configure Windows tray screenshots shell: pwsh run: | + echo "::group::Use dark Windows appearance" + $personalizeSettings = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" + New-Item -Path $personalizeSettings -Force | Out-Null + New-ItemProperty ` + -Path $personalizeSettings ` + -Name "AppsUseLightTheme" ` + -PropertyType DWord ` + -Value 0 ` + -Force | Out-Null + New-ItemProperty ` + -Path $personalizeSettings ` + -Name "SystemUsesLightTheme" ` + -PropertyType DWord ` + -Value 0 ` + -Force | Out-Null + echo "::endgroup::" + echo "::group::Enable all tray icons" $trayIconScript = Join-Path $env:RUNNER_TEMP "Enable-AllTrayIcons.ps1" Invoke-WebRequest ` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 556dd58..dea133f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,9 @@ jobs: - os: ubuntu-latest shell: "bash" qt_version: '6' - - os: windows-latest + # Windows Server 2022 renders QSystemTrayIcon notifications. The newer + # windows-latest image suppresses them in its interactive session. + - os: windows-2022 shell: "msys2 {0}" qt_version: '6' steps: diff --git a/tests/unit/test_tray.cpp b/tests/unit/test_tray.cpp index c1ae075..25290e9 100644 --- a/tests/unit/test_tray.cpp +++ b/tests/unit/test_tray.cpp @@ -402,11 +402,8 @@ TEST_P(TrayNotificationIconTest, TestNotificationDisplay) { trayRunning = (initResult == 0); ASSERT_EQ(initResult, 0); - // Explorer must process the new icon before it can display this icon's notification. + // Let the desktop shell process the new icon before sending its notification. WaitForTrayReady(); - ASSERT_EQ(tray_position_mouse_over_icon(), 0); - WaitForTooltipReady(); - EXPECT_EQ(tray_restore_mouse_position(), 0); dismissNativeNotifications(); // Set notification properties