mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 23:48:35 +00:00
refactor: no need to set from for moveFocus probably
This commit is contained in:
@@ -257,7 +257,7 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
guard surfaceTree.contains(view) else { return }
|
guard surfaceTree.contains(view) else { return }
|
||||||
// Set the target surface as focused before animation
|
// Set the target surface as focused before animation
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
Ghostty.moveFocus(to: view, from: self.focusedSurface)
|
Ghostty.moveFocus(to: view)
|
||||||
}
|
}
|
||||||
// Animation completion handler will handle window/app activation
|
// Animation completion handler will handle window/app activation
|
||||||
animateIn()
|
animateIn()
|
||||||
|
@@ -240,12 +240,7 @@ class BaseTerminalController: NSWindowController,
|
|||||||
|
|
||||||
// Move focus to the target surface and activate the window/app
|
// Move focus to the target surface and activate the window/app
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
// We suppress the spurious unfocus signal by passing nil for `from`
|
Ghostty.moveFocus(to: view)
|
||||||
// when the surface is already the logically focused one.
|
|
||||||
Ghostty.moveFocus(
|
|
||||||
to: view,
|
|
||||||
from: (self.focusedSurface == view) ? nil : self.focusedSurface
|
|
||||||
)
|
|
||||||
view.window?.makeKeyAndOrderFront(nil)
|
view.window?.makeKeyAndOrderFront(nil)
|
||||||
if !NSApp.isActive {
|
if !NSApp.isActive {
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
Reference in New Issue
Block a user