aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-09 03:04:41 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:35 +0530
commitbc8ea55023d547cf59f6417d2d8b35e61f31fdc8 (patch)
tree7f3ef7d7a1a361ba61c7ab2a9ead4a935051fbde /WireGuard
parentmacOS: Fix 'Network' entry in menu (diff)
downloadwireguard-apple-bc8ea55023d547cf59f6417d2d8b35e61f31fdc8.tar.xz
wireguard-apple-bc8ea55023d547cf59f6417d2d8b35e61f31fdc8.zip
macOS: Get the app back in focus after macOS' VPN prompt
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift4
1 files changed, 4 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
index e6b72ca..130cf30 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
@@ -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) {