Skip to content

Commit

Permalink
Fix focus resignation (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgoedjen authored Aug 8, 2021
1 parent 35aea07 commit 9d6bbd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Secretive/Controllers/LaunchAgentController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9d6bbd2

Please sign in to comment.