mac: fix split initial focus

When making a split, the window focus doesn't change so the new splits
were defaulting to "false" (not focused). Let's just assume when a
surface is created that it is in fact focused. This generally fixes the
issue.

If we ever programmatically create splits in background windows this
will probably fail so we should find a way on View init to detect if the
window has focus.
This commit is contained in:
Mitchell Hashimoto
2023-05-27 14:37:00 -07:00
parent 77dcc10f80
commit e998e053b1

View File

@ -42,7 +42,7 @@ extension Ghostty {
@FocusState private var surfaceFocus: Bool
// Maintain whether our window has focus (is key) or not
@State private var windowFocus: Bool = false
@State private var windowFocus: Bool = true
// This is true if the terminal is considered "focused". The terminal is focused if
// it is both individually focused and the containing window is key.