From ec989d6b46f1396c97978ef6dbfcb973ccfd397b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 8 Dec 2023 08:46:05 -0800 Subject: [PATCH] macos: newTab needs to call Controller.showWindow --- macos/Sources/Features/Terminal/TerminalManager.swift | 5 +++++ macos/Sources/Ghostty/SurfaceView.swift | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Features/Terminal/TerminalManager.swift b/macos/Sources/Features/Terminal/TerminalManager.swift index feefa9da9..c532285ef 100644 --- a/macos/Sources/Features/Terminal/TerminalManager.swift +++ b/macos/Sources/Features/Terminal/TerminalManager.swift @@ -122,6 +122,11 @@ class TerminalManager { tg.removeWindow(window) } + // Our windows start our invisible. We need to make it visible. If we + // don't do this then various features such as window blur won't work because + // the macOS APIs only work on a visible window. + controller.showWindow(self) + // Add the window to the tab group and show it parent.addTabbedWindow(window, ordered: .above) window.makeKeyAndOrderFront(self) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index ee79d0cc3..e83f08cc3 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -486,7 +486,7 @@ extension Ghostty { cursorUpdate(with: NSEvent()) } } - + override func viewDidMoveToWindow() { guard let window = self.window else { return } guard let surface = self.surface else { return }