Skip to content

fix(macos): properly handle accessibility permission #2508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Hazer
Copy link
Member

@Hazer Hazer commented May 7, 2024

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

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • 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

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • 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.

  • I want maintainers to keep my branch updated

Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.59%. Comparing base (f921ae4) to head (31a1462).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2508   +/-   ##
=======================================
  Coverage   11.59%   11.59%           
=======================================
  Files          92       92           
  Lines       17358    17358           
  Branches     8106     8106           
=======================================
  Hits         2013     2013           
  Misses      12853    12853           
  Partials     2492     2492           
Flag Coverage Δ
Linux 11.25% <ø> (ø)
Windows 13.00% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Hazer Hazer marked this pull request as draft May 7, 2024 15:02
@Hazer
Copy link
Member Author

Hazer commented May 7, 2024

Needs test coverage on the new methods

@Hazer
Copy link
Member Author

Hazer commented May 24, 2024

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

@Hazer Hazer force-pushed the fix/macos-accessibility-request branch from 2340497 to 062d1fb Compare May 24, 2024 23:06
@Hazer
Copy link
Member Author

Hazer commented Jun 5, 2024

Waiting for #2550 to create the tests

@Hazer Hazer mentioned this pull request Jun 11, 2024
11 tasks
@Hazer Hazer force-pushed the fix/macos-accessibility-request branch from 062d1fb to c24e808 Compare July 14, 2024 00:41
@Hazer
Copy link
Member Author

Hazer commented Aug 6, 2024

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

@Hazer Hazer force-pushed the fix/macos-accessibility-request branch 3 times, most recently from d8d4ada to 96505cc Compare December 5, 2024 03:14
@Hazer
Copy link
Member Author

Hazer commented Dec 5, 2024

Revisiting this PR, fixing conflicts first to get this on track

@Hazer
Copy link
Member Author

Hazer commented Dec 5, 2024

Should I include a manual request in the web ui? Or the status saying whether the permission is given or not? @ReenigneArcher

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Dec 5, 2024

Should I include a manual request in the web ui? Or the status saying whether the permission is given or not? @ReenigneArcher

This sounds like a good idea... should it be a separate PR?

@Hazer
Copy link
Member Author

Hazer commented Dec 5, 2024

@ReenigneArcher not sure. I may do it in the same, so I can improve the API around it once, cause it may change where it is declared, and as I have some code quality issues to review, I may do it in a single pass

@Hazer Hazer force-pushed the fix/macos-accessibility-request branch 2 times, most recently from 915c7bf to a2e3b24 Compare December 23, 2024 23:37
@Hazer Hazer force-pushed the fix/macos-accessibility-request branch from a2e3b24 to 9ee1221 Compare December 25, 2024 23:20
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues
2 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@LizardByte-bot
Copy link
Member

It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!

# Conflicts:
#	src/platform/macos/display.mm
#	src/platform/macos/input.cpp
#	src/platform/macos/misc.h
#	src/platform/macos/misc.mm
@ReenigneArcher
Copy link
Member

Revisiting this PR, fixing conflicts first to get this on track

@Hazer I brought this PR up to date. I'd like to get it in, even if there are no unit tests at this time. What do you think?

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues
2 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The mouse cursor always stay at the top left corner on macOS
3 participants