From 4a264abadd5ff4f96d519688e09c45db1ffb2529 Mon Sep 17 00:00:00 2001 From: Zachary Wander Date: Fri, 12 Nov 2021 20:31:08 +0900 Subject: [PATCH] fix: the app would sometimes freeze or lag (closes #563) --- src/logic/events/AccessibilityEvents.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logic/events/AccessibilityEvents.swift b/src/logic/events/AccessibilityEvents.swift index fe2377f8..0ca987ce 100644 --- a/src/logic/events/AccessibilityEvents.swift +++ b/src/logic/events/AccessibilityEvents.swift @@ -11,7 +11,7 @@ fileprivate func handleEvent(_ type: String, _ element: AXUIElement) throws { debugPrint("Accessibility event", type, type != kAXFocusedUIElementChangedNotification ? (try element.title() ?? "nil") : "nil") // events are handled concurrently, thus we check that the app is still running if let pid = try element.pid(), - try (!(pid == ProcessInfo.processInfo.processIdentifier && element.subrole() == kAXUnknownSubrole)) { + try pid != ProcessInfo.processInfo.processIdentifier || (element.subrole() != kAXUnknownSubrole && type != kAXFocusedUIElementChangedNotification) { switch type { case kAXApplicationActivatedNotification: try applicationActivated(element, pid) case kAXApplicationHiddenNotification,