mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 23:48:35 +00:00
refactor: improve asynchronous delay by delegating window/app activation process to animateIn
This commit is contained in:
@@ -253,10 +253,14 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
super.focusSurface(view)
|
super.focusSurface(view)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
animateIn()
|
// Check if target surface belongs to this quick terminal
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + derivedConfig.quickTerminalAnimationDuration) {
|
guard surfaceTree.contains(view) else { return }
|
||||||
super.focusSurface(view)
|
// Set the target surface as focused before animation
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
Ghostty.moveFocus(to: view, from: self.focusedSurface)
|
||||||
}
|
}
|
||||||
|
// Animation completion handler will handle window/app activation
|
||||||
|
animateIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func surfaceTreeDidChange(from: SplitTree<Ghostty.SurfaceView>, to: SplitTree<Ghostty.SurfaceView>) {
|
override func surfaceTreeDidChange(from: SplitTree<Ghostty.SurfaceView>, to: SplitTree<Ghostty.SurfaceView>) {
|
||||||
|
Reference in New Issue
Block a user