From 6bb3f23c23ed23662f84d9052af29641f1647c9a Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Sun, 13 Oct 2024 02:08:25 +0200 Subject: [PATCH] AXUIElementSetMessagingTimeout set to 1 second https://github.com/nikitabobko/AeroSpace/issues/131 It probably won't resolve the problem, but it's a low effort commit that should make the situation better, avoiding complete freezes --- Sources/AppBundle/initAppBundle.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/AppBundle/initAppBundle.swift b/Sources/AppBundle/initAppBundle.swift index cef66149..01d27db9 100644 --- a/Sources/AppBundle/initAppBundle.swift +++ b/Sources/AppBundle/initAppBundle.swift @@ -1,6 +1,9 @@ +import AppKit import Common import Foundation +let systemWideAx = AXUIElementCreateSystemWide() + public func initAppBundle() { initTerminationHandler() isCli = false @@ -17,6 +20,7 @@ public func initAppBundle() { printStderr("--started-at-login is passed but 'started-at-login = false' in the config. Terminating...") terminateApp() } + AXUIElementSetMessagingTimeout(systemWideAx, 1.0) checkAccessibilityPermissions() startUnixSocketServer()