macos: Remove the legacy SurfaceTree

This commit is contained in:
Mitchell Hashimoto
2025-06-04 11:51:38 -07:00
parent 22819f8a29
commit f1ed07caf4
6 changed files with 24 additions and 37 deletions

View File

@@ -30,11 +30,11 @@ class QuickTerminalController: BaseTerminalController {
init(_ ghostty: Ghostty.App,
position: QuickTerminalPosition = .top,
baseConfig base: Ghostty.SurfaceConfiguration? = nil,
surfaceTree tree: Ghostty.SplitNode? = nil
surfaceTree2 tree2: SplitTree<Ghostty.SurfaceView>? = nil
) {
self.position = position
self.derivedConfig = DerivedConfig(ghostty.config)
super.init(ghostty, baseConfig: base, surfaceTree: tree)
super.init(ghostty, baseConfig: base, surfaceTree2: tree2)
// Setup our notifications for behaviors
let center = NotificationCenter.default
@@ -233,13 +233,14 @@ class QuickTerminalController: BaseTerminalController {
// Animate the window in
animateWindowIn(window: window, from: position)
// If our surface tree is nil then we initialize a new terminal. The surface
// tree can be nil if for example we run "eixt" in the terminal and force
// If our surface tree is empty then we initialize a new terminal. The surface
// tree can be empty if for example we run "exit" in the terminal and force
// animate out.
if (surfaceTree == nil) {
let leaf: Ghostty.SplitNode.Leaf = .init(ghostty.app!, baseConfig: nil)
surfaceTree = .leaf(leaf)
focusedSurface = leaf.surface
if surfaceTree2.isEmpty,
let ghostty_app = ghostty.app {
let view = Ghostty.SurfaceView(ghostty_app, baseConfig: nil)
surfaceTree2 = SplitTree(view: view)
focusedSurface = view
}
}