From e998e053b1821d48da2f941dabff76757ad675b5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 27 May 2023 14:37:00 -0700 Subject: [PATCH] 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. --- macos/Sources/Ghostty/SurfaceView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 1bbf15fe4..1655eb849 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -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.