Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

fix(macos): properly handle accessibility permission

Open Hazer opened this issue 9 months ago • 10 comments

Description

Check for macOS Accessibility permission to allow mouse and keyboard input events to work properly.

  • Automatically includes sunshine to the Accessibility list in the Settings pane, no need to find out the binary path;
  • Shows prompt to user;
  • Logs to the user every time we receive an input event that won't execute because of missing accessibility permission.

Issues Fixed or Closed

  • Resolves #2801 for users that haven't added Accessibility permissions.

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Dependency update (updates to dependencies)
  • [ ] Documentation update (changes to documentation)
  • [ ] Repository update (changes to repository files, e.g. .github/...)

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch must be updated before it can be merged. You must also Allow edits from maintainers.

  • [x] I want maintainers to keep my branch updated

Hazer avatar May 07 '24 04:05 Hazer

Codecov Report

Attention: Patch coverage is 19.04762% with 17 lines in your changes missing coverage. Please review.

Project coverage is 9.13%. Comparing base (18e7dfb) to head (c24e808).

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #2508      +/-   ##
=========================================
+ Coverage    9.12%   9.13%   +0.01%     
=========================================
  Files          97      97              
  Lines       17433   17451      +18     
  Branches     8314    8321       +7     
=========================================
+ Hits         1590    1594       +4     
- Misses      13021   15056    +2035     
+ Partials     2822     801    -2021     
Flag Coverage Δ
Linux 6.83% <ø> (ø)
Windows 4.35% <ø> (ø)
macOS-12 10.19% <19.04%> (+0.01%) :arrow_up:
macOS-13 10.10% <19.04%> (+0.02%) :arrow_up:
macOS-14 10.42% <19.04%> (+0.02%) :arrow_up:

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

Files Coverage Δ
src/platform/macos/misc.mm 7.96% <50.00%> (+1.11%) :arrow_up:
src/platform/macos/input.cpp 34.21% <6.66%> (-2.37%) :arrow_down:

... and 31 files with indirect coverage changes

codecov[bot] avatar May 07 '24 13:05 codecov[bot]

Needs test coverage on the new methods

Hazer avatar May 07 '24 15:05 Hazer

If we are going to test this, this has to be tested only on CI, this cannot be tested on macports test action.

Hazer avatar May 24 '24 18:05 Hazer

Waiting for https://github.com/LizardByte/Sunshine/pull/2550 to create the tests

Hazer avatar Jun 05 '24 20:06 Hazer

This needs to be updated and tested on macOS Sequoia before merging.

Hazer avatar Aug 06 '24 04:08 Hazer