From 286749e930b7f2217525452e35d8b7835a04990c Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:09:19 +0100 Subject: [PATCH] macos: move terminalViewContainer under BaseTerminalController --- .../Features/QuickTerminal/QuickTerminalController.swift | 6 +++--- macos/Sources/Features/Terminal/TerminalController.swift | 6 +++--- macos/Sources/Features/Terminal/TerminalViewContainer.swift | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift index 26fae7556..eb28942ee 100644 --- a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift +++ b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift @@ -159,7 +159,7 @@ class QuickTerminalController: BaseTerminalController { // applies if we can be seen. guard visible else { return } - window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true) + terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true) // Re-hide the dock if we were hiding it before. hiddenDock?.hide() @@ -174,7 +174,7 @@ class QuickTerminalController: BaseTerminalController { // ensures we don't run logic twice. guard visible else { return } - window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false) + terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false) // We don't animate out if there is a modal sheet being shown currently. // This lets us show alerts without causing the window to disappear. @@ -709,7 +709,7 @@ class QuickTerminalController: BaseTerminalController { syncAppearance() - window?.terminalViewContainer?.ghosttyConfigDidChange(config, preferredBackgroundColor: nil) + terminalViewContainer?.ghosttyConfigDidChange(config, preferredBackgroundColor: nil) } @objc private func onNewTab(notification: SwiftUI.Notification) { diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index 736ca8b74..c2c06e6e6 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -585,7 +585,7 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr // Call this last in case it uses any of the properties above. window.syncAppearance(surfaceConfig) - window.terminalViewContainer?.ghosttyConfigDidChange(ghostty.config, preferredBackgroundColor: window.preferredBackgroundColor) + terminalViewContainer?.ghosttyConfigDidChange(ghostty.config, preferredBackgroundColor: window.preferredBackgroundColor) } /// Adjusts the given frame for the configured window position. @@ -1147,12 +1147,12 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr super.windowDidBecomeKey(notification) self.relabelTabs() self.fixTabBar() - window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true) + terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true) } override func windowDidResignKey(_ notification: Notification) { super.windowDidResignKey(notification) - window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false) + terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false) } override func windowDidMove(_ notification: Notification) { diff --git a/macos/Sources/Features/Terminal/TerminalViewContainer.swift b/macos/Sources/Features/Terminal/TerminalViewContainer.swift index fb310a0cc..92832efec 100644 --- a/macos/Sources/Features/Terminal/TerminalViewContainer.swift +++ b/macos/Sources/Features/Terminal/TerminalViewContainer.swift @@ -77,11 +77,11 @@ class TerminalViewContainer: NSView { } } -// MARK: - NSWindow + terminalViewContainer +// MARK: - BaseTerminalController + terminalViewContainer -extension NSWindow { +extension BaseTerminalController { var terminalViewContainer: TerminalViewContainer? { - contentView as? TerminalViewContainer + window?.contentView as? TerminalViewContainer } }