Skip to content

Commit

Permalink
🐛 Loop will now only trigger when accessibility access is granted
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Aug 10, 2023
1 parent ce88f35 commit 9744a17
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Loop/Radial Menu/RadialMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9744a17

Please sign in to comment.