You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tray): continue when system tray is unavailable - #5968
When system tray initialization fails, Sunshine enters the tray event loop and treats its immediate exit as a shutdown request. This prevents startup when a desktop tray is unavailable, such as in some headless or SSH sessions.
Wait for Sunshine's normal shutdown event when the tray was not initialized, keeping the web UI and streaming workers running. Log that Sunshine is continuing without a tray. An initialized tray retains its existing shutdown behavior.
Added regression tests that verify an unavailable tray does not raise the workers' shutdown event, waits for an explicit shutdown request, and honors an already-pending shutdown.
❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.42%. Comparing base (cf0fff2) to head (3047ee3).
✅ All tests successful. No failed tests found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When system tray initialization fails, Sunshine enters the tray event loop and treats its immediate exit as a shutdown request. This prevents startup when a desktop tray is unavailable, such as in some headless or SSH sessions.
Wait for Sunshine's normal shutdown event when the tray was not initialized, keeping the web UI and streaming workers running. Log that Sunshine is continuing without a tray. An initialized tray retains its existing shutdown behavior.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
Added regression tests that verify an unavailable tray does not raise the workers' shutdown event, waits for an explicit shutdown request, and honors an already-pending shutdown.
Validated on Windows with MSYS2/UCRT64:
cmake --build cmake-build-release --target test_sunshine -j2: passed.test_sunshine.exe --gtest_filter=SystemTrayTest.*:LicenseStates/UnlicensedVirtualHidTrayTest.*: 16 passed; 1 Windows CI setup test skipped.cmake --build cmake-build-release --target docs -j2: strict documentation build passed.uv run --locked lb-update-clang-formatandgit diff --check: passed.The reported Linux boot/SSH environment was not reproduced locally.
Type of Change
Checklist
AI Usage
See our AI usage policy.