From 9d6bbd2a04c0bf542a4b228b56102245eb3fe6a8 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 8 Aug 2021 15:57:01 -0700 Subject: [PATCH] Fix focus resignation (#227) --- Secretive/Controllers/LaunchAgentController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Secretive/Controllers/LaunchAgentController.swift b/Secretive/Controllers/LaunchAgentController.swift index b9777c8..d50299d 100644 --- a/Secretive/Controllers/LaunchAgentController.swift +++ b/Secretive/Controllers/LaunchAgentController.swift @@ -22,7 +22,9 @@ struct LaunchAgentController { func forceLaunch(completion: ((Bool) -> Void)?) { Logger().debug("Agent is not running, attempting to force launch") let url = Bundle.main.bundleURL.appendingPathComponent("Contents/Library/LoginItems/SecretAgent.app") - NSWorkspace.shared.openApplication(at: url, configuration: NSWorkspace.OpenConfiguration()) { app, error in + let config = NSWorkspace.OpenConfiguration() + config.activates = false + NSWorkspace.shared.openApplication(at: url, configuration: config) { app, error in DispatchQueue.main.async { completion?(error == nil) }