aerospace fork
Something went wrong. Try again.
1234567891011121314151617181920212223242526import AppKitimport Common
@MainActorvar appForTests: (any AbstractApp)? = nil
@MainActorprivate var focusedApp: (any AbstractApp)? { get async throws { if isUnitTest { return appForTests } else { check(appForTests == nil) return switch NSWorkspace.shared.frontmostApplication { case let frontmostApplication?: try await MacApp.getOrRegister(frontmostApplication) case nil: nil } } }}
@MainActorfunc getNativeFocusedWindow(_ cm: CancellationMode) async throws -> Window? { try await focusedApp?.getFocusedWindow(cm)}