mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-05 19:08:17 +00:00
macos: unzoom on new split and focus change
This commit is contained in:
@@ -108,11 +108,12 @@ extension SplitTree {
|
||||
}
|
||||
|
||||
/// Insert a new view at the given view point by creating a split in the given direction.
|
||||
/// This will always reset the zoomed state of the tree.
|
||||
func insert(view: ViewType, at: ViewType, direction: NewDirection) throws -> Self {
|
||||
guard let root else { throw SplitError.viewNotFound }
|
||||
return .init(
|
||||
root: try root.insert(view: view, at: at, direction: direction),
|
||||
zoomed: zoomed)
|
||||
zoomed: nil)
|
||||
}
|
||||
|
||||
/// Remove a node from the tree. If the node being removed is part of a split,
|
||||
|
@@ -451,6 +451,11 @@ class BaseTerminalController: NSWindowController,
|
||||
return
|
||||
}
|
||||
|
||||
// Remove the zoomed state for this surface tree.
|
||||
if surfaceTree.zoomed != nil {
|
||||
surfaceTree = .init(root: surfaceTree.root, zoomed: nil)
|
||||
}
|
||||
|
||||
// Move focus to the next surface
|
||||
Ghostty.moveFocus(to: nextSurface, from: target)
|
||||
}
|
||||
|
Reference in New Issue
Block a user