mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 15:38:35 +00:00
feat: focus terminal in basic cases
This commit is contained in:
@@ -233,6 +233,16 @@ class BaseTerminalController: NSWindowController,
|
||||
return newView
|
||||
}
|
||||
|
||||
func focusSurface(_ view: Ghostty.SurfaceView) {
|
||||
guard surfaceTree.contains(view) else { return }
|
||||
|
||||
DispatchQueue.main.async {
|
||||
Ghostty.moveFocus(to: view, from: self.focusedSurface)
|
||||
view.window?.makeKeyAndOrderFront(nil)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
}
|
||||
|
||||
/// Called when the surfaceTree variable changed.
|
||||
///
|
||||
/// Subclasses should call super first.
|
||||
|
Reference in New Issue
Block a user