fix: the app would sometimes freeze or lag (closes #563)
This commit is contained in:
1 parent
21133ce118
commit
4a264abadd
1 file changed
+1
-1
@@ -11,7 +11,7 @@ fileprivate func handleEvent(_ type: String, _ element: AXUIElement) throws {
|
|||||||
debugPrint("Accessibility event", type, type != kAXFocusedUIElementChangedNotification ? (try element.title() ?? "nil") : "nil")
|
debugPrint("Accessibility event", type, type != kAXFocusedUIElementChangedNotification ? (try element.title() ?? "nil") : "nil")
|
||||||
// events are handled concurrently, thus we check that the app is still running
|
// events are handled concurrently, thus we check that the app is still running
|
||||||
if let pid = try element.pid(),
|
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 {
|
switch type {
|
||||||
case kAXApplicationActivatedNotification: try applicationActivated(element, pid)
|
case kAXApplicationActivatedNotification: try applicationActivated(element, pid)
|
||||||
case kAXApplicationHiddenNotification,
|
case kAXApplicationHiddenNotification,
|
||||||
|
|||||||
Reference in new issue
Block a user