refactor: no need to set from for moveFocus probably

This commit is contained in:
himura467
2025-09-30 05:58:21 +09:00
parent bc3d0b7cbc
commit b3d0b6a965
2 changed files with 2 additions and 7 deletions

View File

@@ -257,7 +257,7 @@ class QuickTerminalController: BaseTerminalController {
guard surfaceTree.contains(view) else { return }
// Set the target surface as focused before animation
DispatchQueue.main.async {
Ghostty.moveFocus(to: view, from: self.focusedSurface)
Ghostty.moveFocus(to: view)
}
// Animation completion handler will handle window/app activation
animateIn()

View File

@@ -240,12 +240,7 @@ class BaseTerminalController: NSWindowController,
// Move focus to the target surface and activate the window/app
DispatchQueue.main.async {
// We suppress the spurious unfocus signal by passing nil for `from`
// when the surface is already the logically focused one.
Ghostty.moveFocus(
to: view,
from: (self.focusedSurface == view) ? nil : self.focusedSurface
)
Ghostty.moveFocus(to: view)
view.window?.makeKeyAndOrderFront(nil)
if !NSApp.isActive {
NSApp.activate(ignoringOtherApps: true)