From 4fd114b8a9eab7383b88a2b72b01239a72e87c84 Mon Sep 17 00:00:00 2001 From: luckman212 <1992842+luckman212@users.noreply.github.com> Date: Wed, 26 Oct 2022 17:25:12 -0400 Subject: [PATCH] DRAFT -- not for production use! --- Sources/WireGuardApp/UI/macOS/AppDelegate.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/WireGuardApp/UI/macOS/AppDelegate.swift b/Sources/WireGuardApp/UI/macOS/AppDelegate.swift index f1ed4cd31..fd21211a7 100644 --- a/Sources/WireGuardApp/UI/macOS/AppDelegate.swift +++ b/Sources/WireGuardApp/UI/macOS/AppDelegate.swift @@ -151,6 +151,11 @@ class AppDelegate: NSObject, NSApplicationDelegate { return false } + func applicationShouldHandleReopen(_: NSApplication, hasVisibleWindows _: Bool) -> Bool { + self?.showManageTunnelsWindow(completion: nil) + return true + } + private func setDockIconAndMainMenuVisibility(isVisible: Bool, completion: (() -> Void)? = nil) { let currentActivationPolicy = NSApp.activationPolicy() let newActivationPolicy: NSApplication.ActivationPolicy = isVisible ? .regular : .accessory