macOS: Show app in dock when showing the manage tunnels window
This way, the app can participate in Cmd+Tab
This commit is contained in:
parent
227ebef371
commit
d3c3dcb924
|
@ -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