diff options
author | Roopesh Chander <roop@roopc.net> | 2019-05-26 00:08:13 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-05-26 00:12:47 +0530 |
commit | a18614d6b3251a66f8d30df9d53072c7b3589b12 (patch) | |
tree | c623e2029ba96192d0a8400e9adb5eb9716f8b82 /WireGuard | |
parent | macOS: do not call out to recent tunnels tracker (diff) | |
download | wireguard-apple-a18614d6b3251a66f8d30df9d53072c7b3589b12.tar.xz wireguard-apple-a18614d6b3251a66f8d30df9d53072c7b3589b12.zip |
macOS: Fix residual menu highlight on reopen
If we close the window with Cmd+W or Cmd+Q and then re-launch the app,
the main menu shows residual highlight from the close action. This
commit fixes that.
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/AppDelegate.swift | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift index d7a088b..ba2b0bd 100644 --- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift +++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift @@ -135,7 +135,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { } func applicationShouldTerminateAfterLastWindowClosed(_ application: NSApplication) -> Bool { - setDockIconAndMainMenuVisibility(isVisible: false) + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(200)) { [weak self] in + self?.setDockIconAndMainMenuVisibility(isVisible: false) + } return false } |