mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[PR #1636] Add support on MacOS to detect when the accessibility permission is removed #1823
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#1823
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/debauchee/barrier/pull/1636
Author: @sirnacnud
Created: 4/5/2022
Status: 🔄 Open
Base:
master← Head:accessibility-permission📝 Commits (2)
de20904Add support on MacOS to detect when the accessibility permission is removed8baddb1Remove QDebug include📊 Changes
6 files changed (+104 additions, -1 deletions)
View changed files
➕
doc/newsfragments/mac-accessibility-permission.feature(+1 -0)📝
src/gui/CMakeLists.txt(+2 -0)➕
src/gui/src/AccessibilityPermissionObserver.cpp(+52 -0)➕
src/gui/src/AccessibilityPermissionObserver.h(+34 -0)📝
src/gui/src/MainWindow.cpp(+13 -1)📝
src/gui/src/MainWindow.h(+2 -0)📄 Description
On macOS if you are running the barrier server and you remove the accessibility permission in System Preferences, your computer becomes unusable. You are able to move the mouse pointer around, but no clicks go through and none of the keyboard input either. I had to manually restart my computer using the power button. I guess what happens is that barrier continues to capture the input, but can't forward it on as the accessibility permission has been removed.
My fix is to periodically check if the accessibility permission is enabled and if not, terminate the application. MacOS provides no API to be notified when this permission changes, so we have to basically poll it. The fix currently checks every second, but only when barrier is started.
Contributor Checklist:
doc/newsfragmentsdirectory IF it is auser-visible change (and make sure to read the
README.mdin that directory)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.