aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-05-22 15:18:50 +0530
committerRoopesh Chander <roop@roopc.net>2019-05-22 15:19:57 +0530
commite582155a10f0c1cabec18aa887299fc159fe9695 (patch)
treea24a8d301d308263f95dc6caad6fff3891904303 /WireGuard
parentmacOS: Simplify detecting the type of an Apple event (diff)
downloadwireguard-apple-e582155a10f0c1cabec18aa887299fc159fe9695.tar.xz
wireguard-apple-e582155a10f0c1cabec18aa887299fc159fe9695.zip
macOS: Ensure window is shown on app reopening
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppDelegate.swift8
1 files changed, 8 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
index 0860166..b53deb7 100644
--- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
@@ -56,6 +56,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
+ func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows: Bool) -> Bool {
+ if hasVisibleWindows {
+ return true
+ }
+ showManageTunnelsWindow(completion: nil)
+ return false
+ }
+
@objc func quit() {
if let manageWindow = manageTunnelsWindowObject, manageWindow.attachedSheet != nil {
NSApp.activate(ignoringOtherApps: true)