From bc8ea55023d547cf59f6417d2d8b35e61f31fdc8 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 9 Jan 2019 03:04:41 +0530 Subject: macOS: Get the app back in focus after macOS' VPN prompt Signed-off-by: Roopesh Chander --- .../UI/macOS/ViewController/TunnelsListTableViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'WireGuard') 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) { -- cgit v1.2.3-59-g8ed1b