Request Accessibility at launch so the tray can populate

The Menu Bar section silently stayed empty because nothing prompted for
Accessibility permission until a button inside the panel was clicked, so
the app looked inert. Prompt once on first launch instead.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
This commit is contained in:
2026-09-26 23:39:20 +08:00
parent 9b5031aff2
commit 83cb12eddc
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -37,6 +37,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
AppListModel.shared.start() AppListModel.shared.start()
MenuBarItemManager.shared.start() MenuBarItemManager.shared.start()
MenuBarHider.shared.prepare() MenuBarHider.shared.prepare()
// The tray is empty without Accessibility permission, so surface the
// system prompt once at launch instead of waiting for the user to
// open the panel and find the button.
if !AccessibilityPermission.isGranted,
!UserDefaults.standard.bool(forKey: "didRequestAccessibility") {
UserDefaults.standard.set(true, forKey: "didRequestAccessibility")
AccessibilityPermission.request()
}
} }
func applicationWillTerminate(_ notification: Notification) { func applicationWillTerminate(_ notification: Notification) {
+1 -1
View File
@@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
cd "$(dirname "$0")" cd "$(dirname "$0")"
VERSION="${1:-0.2.0}" VERSION="${1:-0.2.1}"
swift build -c release swift build -c release