diff --git a/.github/actions/configure-windows-tray-screenshots/action.yml b/.github/actions/configure-windows-tray-screenshots/action.yml index 856b454f..3fe26465 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 556dd58a..dea133f9 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 0a72b9bc..25290e9f 100644 --- a/tests/unit/test_tray.cpp +++ b/tests/unit/test_tray.cpp @@ -401,6 +401,9 @@ TEST_P(TrayNotificationIconTest, TestNotificationDisplay) { int initResult = tray_init(&testTray); trayRunning = (initResult == 0); ASSERT_EQ(initResult, 0); + + // Let the desktop shell process the new icon before sending its notification. + WaitForTrayReady(); dismissNativeNotifications(); // Set notification properties