]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
macOS: Get the app back in focus after macOS' VPN prompt
authorRoopesh Chander <roop@roopc.net>
Tue, 8 Jan 2019 21:34:41 +0000 (03:04 +0530)
committerRoopesh Chander <roop@roopc.net>
Mon, 14 Jan 2019 09:22:35 +0000 (14:52 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift

index e6b72ca3b92bdb274f346b36a9ad2d39a9db3acf..130cf303610d909131bfbed533064bb64c7b4b60 100644 (file)
@@ -234,6 +234,10 @@ extension TunnelsListTableViewController {
         if tunnelsManager.numberOfTunnels() == 1 {
             selectTunnel(at: 0)
         }
+        if !NSApp.isActive {
+            // macOS's VPN prompt might have caused us to lose focus
+            NSApp.activate(ignoringOtherApps: true)
+        }
     }
 
     func tunnelModified(at index: Int) {