macOS: Show app in dock when showing the manage tunnels window
This way, the app can participate in Cmd+Tab Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
69b33c0fad
commit
5e5481b69b
|
@ -97,6 +97,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
}
|
}
|
||||||
return .terminateCancel
|
return .terminateCancel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func applicationShouldTerminateAfterLastWindowClosed(_ application: NSApplication) -> Bool {
|
||||||
|
application.setActivationPolicy(.accessory)
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AppDelegate: StatusMenuWindowDelegate {
|
extension AppDelegate: StatusMenuWindowDelegate {
|
||||||
|
|
|
@ -151,12 +151,14 @@ class StatusMenu: NSMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func manageTunnelsClicked() {
|
@objc func manageTunnelsClicked() {
|
||||||
|
NSApp.setActivationPolicy(.regular)
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
guard let manageTunnelsWindow = windowDelegate?.manageTunnelsWindow() else { return }
|
guard let manageTunnelsWindow = windowDelegate?.manageTunnelsWindow() else { return }
|
||||||
manageTunnelsWindow.makeKeyAndOrderFront(self)
|
manageTunnelsWindow.makeKeyAndOrderFront(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func importTunnelsClicked() {
|
@objc func importTunnelsClicked() {
|
||||||
|
NSApp.setActivationPolicy(.regular)
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
guard let manageTunnelsWindow = windowDelegate?.manageTunnelsWindow() else { return }
|
guard let manageTunnelsWindow = windowDelegate?.manageTunnelsWindow() else { return }
|
||||||
manageTunnelsWindow.makeKeyAndOrderFront(self)
|
manageTunnelsWindow.makeKeyAndOrderFront(self)
|
||||||
|
|
Loading…
Reference in New Issue