Skip to content

feat(permissions): expose platform access and restart after grants - #5820

Merged
ReenigneArcher merged 3 commits into
masterfrom
fix/permissions-visibility
Sep 29, 2026
Merged

ReenigneArcher merged 3 commits into
masterfrom
fix/permissions-visibility

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Description

Add a shared permission status model and authenticated Web UI endpoints. Show required and optional access on the Home and Troubleshooting pages, with native request actions or platform setup guidance as appropriate.

Request screen capture, input, microphone, and optional notifications at macOS startup. Probe System Audio Recording with a temporary tap and show Local Network and System Audio as on-use where passive checks are unavailable. Check virtual input device access on Linux and FreeBSD and configuration directory access on Windows.

When verifiable required access is missing at launch, restart Sunshine once after the running process can confirm it was granted. Document the platform limits and add native, HTTP, and Web UI tests for the new behavior.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@ReenigneArcher ReenigneArcher added the roadmap This PR closes a roadmap entry label Sep 27, 2026
@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 12.72kB (0.37%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sunshine-esm 989.93kB 12.72kB (1.3%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 3.85kB 399.79kB 0.97%
assets/index-*.css 1.22kB 284.01kB 0.43%
assets/Home-*.js 714 bytes 54.94kB 1.32%
assets/Troubleshooting-*.js 5.46kB 38.14kB 16.7% ⚠️
images/logo-*.svg (New) 1.48kB 1.48kB 100.0% 🚀

Files in assets/index-*.js:

  • ./src_assets/common/assets/web/public/assets/locale/en.json → Total Size: 59.13kB

  • ./src_assets/common/assets/web/sunshine.css → Total Size: 0 bytes

Files in assets/Home-*.js:

  • ./src_assets/common/assets/web/Home.vue → Total Size: 17.4kB

Files in assets/Troubleshooting-*.js:

  • ./src_assets/common/assets/web/Troubleshooting.vue → Total Size: 61.1kB

Comment thread tests/unit/platform/test_permissions.cpp Fixed
@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.29730% with 158 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.53%. Comparing base (8ed7f5b) to head (f4e488d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/macos/misc.mm 31.81% 132 Missing and 3 partials ⚠️
src/confighttp.cpp 76.47% 10 Missing and 2 partials ⚠️
src_assets/common/assets/web/Troubleshooting.vue 91.66% 6 Missing ⚠️
src/platform/linux/misc.cpp 75.00% 0 Missing and 2 partials ⚠️
src_assets/common/assets/web/Home.vue 77.77% 2 Missing ⚠️
src/platform/windows/misc.cpp 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5820      +/-   ##
==========================================
+ Coverage   39.29%   39.53%   +0.24%     
==========================================
  Files         120      122       +2     
  Lines       27830    28190     +360     
  Branches    12189    12323     +134     
==========================================
+ Hits        10936    11146     +210     
+ Misses      15429    14791     -638     
- Partials     1465     2253     +788     
Flag Coverage Δ
Alpine-aarch64 23.82% <60.93%> (+0.14%) ⬆️
Alpine-x86_64 23.94% <60.93%> (+0.14%) ⬆️
Archlinux 21.97% <60.93%> (+0.16%) ⬆️
FreeBSD-amd64 24.11% <52.38%> (+0.11%) ⬆️
Homebrew-macos-15 39.00% <33.20%> (-0.13%) ⬇️
Homebrew-macos-26 39.32% <33.20%> (-0.14%) ⬇️
Homebrew-ubuntu-24.04 25.48% <63.07%> (+0.14%) ⬆️
Linux-AppImage-aarch64 26.67% <68.18%> (+0.15%) ⬆️
Linux-AppImage-x86_64 26.85% <66.66%> (+0.15%) ⬆️
PowerShell 100.00% <ø> (ø)
Web-UI 68.42% <90.12%> (+2.11%) ⬆️
Windows-AMD64 31.07% <67.69%> (+0.17%) ⬆️
Windows-ARM64 26.07% <55.38%> (+0.12%) ⬆️
macOS-arm64 32.40% <39.08%> (+0.10%) ⬆️
macOS-x86_64 32.99% <39.08%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/confighttp.h 100.00% <ø> (ø)
src/platform/macos/av_audio.mm 79.52% <100.00%> (+0.24%) ⬆️
src/platform/permissions.cpp 100.00% <100.00%> (ø)
src/platform/permissions.h 100.00% <100.00%> (ø)
src/system_tray.cpp 80.54% <100.00%> (+0.15%) ⬆️
...ets/common/assets/web/public/assets/locale/en.json 100.00% <ø> (ø)
src/platform/windows/misc.cpp 16.91% <83.33%> (+0.41%) ⬆️
src/platform/linux/misc.cpp 16.11% <75.00%> (+0.63%) ⬆️
src_assets/common/assets/web/Home.vue 71.79% <77.77%> (+0.36%) ⬆️
src_assets/common/assets/web/Troubleshooting.vue 63.19% <91.66%> (+4.67%) ⬆️
... and 2 more

... and 39 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ed7f5b...f4e488d. Read the comment docs.

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Last Updated 2026-09-29 01:41:34 UTC
Source Run CI Run #5864
Commit f4e488df101bf85629bb9782b855936e09150890

Screenshot Comparison

PR #5820 screenshots vs screenshots baseline.

Matrix: AppImage-aarch64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: AppImage-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Comment thread docs/getting_started.md Outdated
Comment thread src/platform/macos/misc.h Outdated
Comment thread src/platform/permissions.cpp
@ReenigneArcher
ReenigneArcher force-pushed the fix/permissions-visibility branch from f54bc13 to fcd1cbf Compare September 28, 2026 19:38
@ReenigneArcher
ReenigneArcher marked this pull request as ready for review September 28, 2026 19:39
@ReenigneArcher
ReenigneArcher force-pushed the fix/permissions-visibility branch from fcd1cbf to b690e1d Compare September 28, 2026 20:03
Add a shared permission status model and authenticated Web UI endpoints.
Show required and optional access on the Home and Troubleshooting pages,
with native request actions or platform setup guidance as appropriate.

Request screen capture, input, microphone, and optional notifications at
macOS startup. Probe System Audio Recording with a temporary tap and show
Local Network and System Audio as on-use where passive checks are unavailable.
Check virtual input device access on Linux and FreeBSD and configuration
directory access on Windows.

When verifiable required access is missing at launch, restart Sunshine once
after the running process can confirm it was granted. Document the platform
limits and add native, HTTP, and Web UI tests for the new behavior.
@ReenigneArcher
ReenigneArcher force-pushed the fix/permissions-visibility branch from b690e1d to 270b280 Compare September 28, 2026 20:16
Persist screen capture and Post Event request history so startup avoids
repeating native prompts while still guiding users to Settings after
consent is removed. Retry Post Event on demand, open recording settings
before probing system audio, and route Local Network to Network Settings
on macOS 15 and newer.

Propagate tray exit to global shutdown so macOS Quit & Reopen releases
Sunshine's ports before relaunch. Update Web UI guidance, documentation,
and tests for macOS 14 through 27.
Split the build-tree icon copy command across lines to satisfy the 120-character CMake lint limit. The bundle resource copy behavior remains unchanged.
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit 052b413 into master Sep 29, 2026
147 of 149 checks passed
@ReenigneArcher
ReenigneArcher deleted the fix/permissions-visibility branch September 29, 2026 01:43
causa-prima added a commit to s0t7x/decky-sunshine that referenced this pull request Sep 30, 2026
From 2026.929 on, Sunshine shuts itself down when its tray loop ends
(LizardByte/Sunshine#5820). Under the plugin the tray can never start -
Sunshine runs as root, without a desktop session - so the loop ends at
once and every start fails with "Sunshine exited before its Web UI came
up" once that version reaches Flathub stable.

start_async now makes sure sunshine.conf has system_tray = disabled
before it spawns Sunshine. A missing key (or a missing config) gets that
line; a key the user set is left alone, and one that enables the tray is
only warned about, naming what it will cost. Truthiness follows
Sunshine's own to_bool. A config that cannot be read or written is
logged and the start goes on.

QT_QPA_PLATFORM=offscreen stays: with the tray disabled Qt never starts,
and for a user who turns the tray back on it still keeps Qt from
aborting the process on 2026.906 to 2026.914.

Co-authored-by: Sebastian Kieritz <2970704+causa-prima@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmap This PR closes a roadmap entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sunshine: Show permission status in UI The mouse cursor always stay at the top left corner on macOS

2 participants