feat(macos): declare LSApplicationCategoryType=games for gamepolicyd treatment#5189
Conversation
…treatment macOS 14+ uses gamepolicyd to decide which processes get game-priority scheduling. The daemon's primary signal is the app's LSApplicationCategoryType: anything matching public.app-category.*games* is recognised as game-related and kept on game-priority scheduling when other games activate Game Mode; everything else can be deprioritised to free resources for the foreground game. Sunshine had been declared as a utility, which meant that when a user streamed a game that engaged Game Mode, the OS would throttle Sunshine's capture and encoder threads as background noise — exactly backwards for a streaming host whose entire purpose is to maintain realtime encode throughput while the streamed game runs hot. Reclassify as public.app-category.games so gamepolicyd treats Sunshine as a peer of the running game. Sunshine itself cannot trigger Game Mode (it is LSUIElement, never frontmost-fullscreen) and this commit does not attempt to; the change is purely about not being throttled when a separate game-categorised app does trigger Game Mode. Inline comment in the plist documents the rationale so future readers don't try to "fix" the seemingly-wrong category.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the macOS app metadata so Sunshine is categorized as a game, aiming to avoid macOS Game Mode deprioritizing its capture/encode threads when streaming.
Changes:
- Change
LSApplicationCategoryTypefrom Utilities to Games. - Add an explanatory comment describing macOS 14+ Game Mode /
gamepolicydscheduling behavior and rationale.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Categorise as a game so gamepolicyd (macOS 14+) treats this process | ||
| as game-related and does not deprioritise its encoder/capture threads | ||
| when the streamed game has Game Mode active. Sunshine itself cannot | ||
| *trigger* Game Mode because it is LSUIElement (no Dock icon, never | ||
| frontmost), but being recognised as game-eligible means the OS keeps | ||
| Sunshine on game-priority scheduling alongside the actual game it is | ||
| streaming, instead of throttling it as a generic background utility. |
|
|
The
Verified on macOS 14+ (M4 Max) — without this PR, capture and encoder threads visibly drop priority when a separate game-category app engages Game Mode; with this PR, scheduling stays consistent under the same workload. Happy to inline either link in the plist comment if you'd prefer that to leaving it as PR context. |
|
You might be able to find some detail in the system log (Console.app) about what the system is doing when a game mode game is running. I learned a lot about how Bluetooth and audio is handled in game mode this way. I would hope that Sunshine's thread & queue priority would be enough to keep it running smoothly. |
|
Closing per maintainer feedback — you have a separate fix for the Game category path. Happy to revisit if useful, but standing down on this one to avoid duplicate work. |



Description
macOS 14+ uses
gamepolicydto decide which processes get game-priority scheduling treatment. The daemon's primary signal is the app'sLSApplicationCategoryType: anything matchingpublic.app-category.*games*is recognised as game-related and kept on game-priority scheduling when other games activate Game Mode. Everything else can be deprioritised to free CPU/GPU resources for the foreground game.Sunshine was previously declared as a utility. When a user streams a game that engages Game Mode (e.g. a native Mac game running fullscreen), the OS treats Sunshine as background noise and throttles its capture and encoder threads — which is exactly backwards for a streaming host whose entire purpose is to maintain realtime encode throughput while the streamed game runs hot.
Reclassifying as
public.app-category.gamescausesgamepolicydto treat Sunshine as a peer of the running game. Encoder threads keep their scheduling priority, capture queue isn't preempted, and the actual streaming throughput stays consistent under load.Important distinction: Sunshine itself does not trigger Game Mode and this PR does not attempt to make it do so. Sunshine is
LSUIElement=true(background utility, no Dock icon, never frontmost-fullscreen) so it can never meetgamepolicyd's Game Mode activation criteria (frontmost + native-fullscreen). The change is purely about Sunshine not being throttled when a separate game-categorised app activates Game Mode.An inline comment in the plist documents the rationale so future readers don't try to "fix" the seemingly-incorrect category. The
LSApplicationCategoryTypeis otherwise informational (no behavioural change outsidegamepolicyd's scheduling heuristics and Mac App Store categorisation, the latter being inapplicable here since Sunshine is not App Store distributed).Screenshot
N/A — Info.plist key change.
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage