diff --git a/Loop/Radial Menu/RadialMenuController.swift b/Loop/Radial Menu/RadialMenuController.swift index de862ea4..90ba720c 100644 --- a/Loop/Radial Menu/RadialMenuController.swift +++ b/Loop/Radial Menu/RadialMenuController.swift @@ -10,6 +10,7 @@ import Defaults class RadialMenuController { + private let accessibilityAccessManager = AccessibilityAccessManager() private let radialMenuKeybindMonitor = KeybindMonitor.shared private let windowEngine = WindowEngine() private let loopPreview = PreviewController() @@ -135,16 +136,19 @@ class RadialMenuController { } private func openLoop() { - frontmostWindow = windowEngine.getFrontmostWindow() + // Loop will only open if accessibility access has been granted + if accessibilityAccessManager.checkAccessibilityAccess() { + frontmostWindow = windowEngine.getFrontmostWindow() - if Defaults[.previewVisibility] == true && frontmostWindow != nil { - loopPreview.showPreview() - } - showRadialMenu(frontmostWindow: frontmostWindow) + if Defaults[.previewVisibility] == true && frontmostWindow != nil { + loopPreview.showPreview() + } + showRadialMenu(frontmostWindow: frontmostWindow) - radialMenuKeybindMonitor.start() + radialMenuKeybindMonitor.start() - isLoopRadialMenuShown = true + isLoopRadialMenuShown = true + } } private func closeLoop(wasForceClosed: Bool = false) {