mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Revert compactMap -> filterMap
This commit is contained in:
@ -575,14 +575,14 @@ class AppDelegate: NSObject,
|
|||||||
/// Toggles visibility of all Ghosty Terminal windows. When hidden, activates Ghostty as the frontmost application
|
/// Toggles visibility of all Ghosty Terminal windows. When hidden, activates Ghostty as the frontmost application
|
||||||
@IBAction func toggleVisibility(_ sender: Any) {
|
@IBAction func toggleVisibility(_ sender: Any) {
|
||||||
// We only care about terminal windows.
|
// We only care about terminal windows.
|
||||||
for window in NSApp.windows.filter({ $0.windowController is BaseTerminalController }) {
|
for controller in NSApp.windows.compactMap({ $0.windowController as? BaseTerminalController }) {
|
||||||
if isVisible {
|
if isVisible {
|
||||||
window.orderOut(nil)
|
controller.window?.orderOut(nil)
|
||||||
} else {
|
} else {
|
||||||
window.makeKeyAndOrderFront(nil)
|
controller.window?.makeKeyAndOrderFront(nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// After bringing them all to front we make sure our app is active too.
|
// After bringing them all to front we make sure our app is active too.
|
||||||
if !isVisible {
|
if !isVisible {
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
Reference in New Issue
Block a user