]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
macOS: Bring app to front before 'exiting with an active tunnel' alert
authorRoopesh Chander <roop@roopc.net>
Thu, 28 Mar 2019 18:40:05 +0000 (00:10 +0530)
committerRoopesh Chander <roop@roopc.net>
Thu, 28 Mar 2019 18:47:37 +0000 (00:17 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/macOS/AppDelegate.swift

index 990a3797d39d0475b20d39aab58a3670ebec4698..e80d97120aff3b95471904ee22cc5c54cf90bd5b 100644 (file)
@@ -57,8 +57,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
         let alert = NSAlert()
         alert.messageText = tr("macAppExitingWithActiveTunnelMessage")
         alert.informativeText = tr("macAppExitingWithActiveTunnelInfo")
-        if let window = manageTunnelsWindowObject {
-            alert.beginSheetModal(for: window) { _ in
+        NSApp.activate(ignoringOtherApps: true)
+        if let manageWindow = manageTunnelsWindowObject {
+            manageWindow.orderFront(self)
+            alert.beginSheetModal(for: manageWindow) { _ in
                 NSApp.terminate(nil)
             }
         } else {