docs(BaseTerminalController)

pull/8961/head
himura467 2025-09-29 00:40:47 +09:00
parent 337ecdd0b3
commit 7ab0a7814b
1 changed files with 3 additions and 0 deletions

View File

@ -233,9 +233,12 @@ class BaseTerminalController: NSWindowController,
return newView
}
/// Move focus to a surface view.
func focusSurface(_ view: Ghostty.SurfaceView) {
// Check if target surface is in our tree
guard surfaceTree.contains(view) else { return }
// Move focus to the target surface and activate the window/app
DispatchQueue.main.async {
Ghostty.moveFocus(to: view, from: self.focusedSurface)
view.window?.makeKeyAndOrderFront(nil)