mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-02 07:58:37 +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)
|
||||
return
|
||||
}
|
||||
animateIn()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + derivedConfig.quickTerminalAnimationDuration) {
|
||||
super.focusSurface(view)
|
||||
// Check if target surface belongs to this quick terminal
|
||||
guard surfaceTree.contains(view) else { return }
|
||||
// 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>) {
|
||||
|
Reference in New Issue
Block a user