[PR #1636] Add support on MacOS to detect when the accessibility permission is removed #1823

Open
opened 2026-05-05 08:02:39 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/1636
Author: @sirnacnud
Created: 4/5/2022
Status: 🔄 Open

Base: masterHead: accessibility-permission


📝 Commits (2)

  • de20904 Add support on MacOS to detect when the accessibility permission is removed
  • 8baddb1 Remove 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:

  • I have created a file in the doc/newsfragments directory IF it is a
    user-visible change (and make sure to read the README.md in that directory)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/1636 **Author:** [@sirnacnud](https://github.com/sirnacnud) **Created:** 4/5/2022 **Status:** 🔄 Open **Base:** `master` ← **Head:** `accessibility-permission` --- ### 📝 Commits (2) - [`de20904`](https://github.com/debauchee/barrier/commit/de20904153b9a88e2872249bd885baee57b5b0c8) Add support on MacOS to detect when the accessibility permission is removed - [`8baddb1`](https://github.com/debauchee/barrier/commit/8baddb1e49b10acda2f08e5d9595bde0189e7cec) Remove QDebug include ### 📊 Changes **6 files changed** (+104 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `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) </details> ### 📄 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: * [x] I have created a file in the `doc/newsfragments` directory *IF* it is a user-visible change (and make sure to read the `README.md` in that directory) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror added the
pull-request
label 2026-05-05 08:02:39 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1823
No description provided.