From a3c51421f7c3506dd7357672ac8bebed36e852e6 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Thu, 3 Oct 2024 11:28:15 +0200 Subject: [PATCH] Revert compactMap -> filterMap --- macos/Sources/App/macOS/AppDelegate.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift index e926e380b..8e04564f9 100644 --- a/macos/Sources/App/macOS/AppDelegate.swift +++ b/macos/Sources/App/macOS/AppDelegate.swift @@ -575,14 +575,14 @@ class AppDelegate: NSObject, /// Toggles visibility of all Ghosty Terminal windows. When hidden, activates Ghostty as the frontmost application @IBAction func toggleVisibility(_ sender: Any) { // 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 { - window.orderOut(nil) + controller.window?.orderOut(nil) } else { - window.makeKeyAndOrderFront(nil) + controller.window?.makeKeyAndOrderFront(nil) } } - + // After bringing them all to front we make sure our app is active too. if !isVisible { NSApp.activate(ignoringOtherApps: true)