From 242858b96340ca170c6d573a24c8805769ac90a5 Mon Sep 17 00:00:00 2001 From: Troels Thomsen Date: Mon, 20 May 2024 10:22:27 +0200 Subject: [PATCH] Color after setting window theme and tab mode --- .../Features/Terminal/TerminalController.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index aab789845..7598b7007 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -259,13 +259,6 @@ class TerminalController: NSWindowController, NSWindowDelegate, // when cascading. window.center() - // Set the background color of the window - let backgroundColor = NSColor(ghostty.config.backgroundColor) - window.backgroundColor = backgroundColor - - // This makes sure our titlebar renders correctly when there is a transparent background - window.titlebarColor = backgroundColor.withAlphaComponent(ghostty.config.backgroundOpacity) - // Make sure our theme is set on the window so styling is correct. if let windowTheme = ghostty.config.windowTheme { window.windowTheme = .init(rawValue: windowTheme) @@ -282,6 +275,13 @@ class TerminalController: NSWindowController, NSWindowDelegate, } } + // Set the background color of the window + let backgroundColor = NSColor(ghostty.config.backgroundColor) + window.backgroundColor = backgroundColor + + // This makes sure our titlebar renders correctly when there is a transparent background + window.titlebarColor = backgroundColor.withAlphaComponent(ghostty.config.backgroundOpacity) + // Initialize our content view to the SwiftUI root window.contentView = NSHostingView(rootView: TerminalView( ghostty: self.ghostty,