mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-06 19:38:23 +00:00
macos: Remove the legacy SurfaceTree
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user