macos: move terminalViewContainer under BaseTerminalController

This commit is contained in:
Lukas
2026-02-27 09:09:19 +01:00
parent 9032096fc7
commit 286749e930
3 changed files with 9 additions and 9 deletions

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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
}
}