From d63c0df58292e8e049d1fa7bf390c0517e03ddfc Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Sat, 21 Oct 2023 08:08:54 -0700 Subject: [PATCH] macos: always apply initial size to new windows We would previously exit early for non-transparent windows, which skipped the call to setInitialWindowSize(). --- macos/Sources/Ghostty/SurfaceView.swift | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 8752ebe08..4fa0247e2 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -449,16 +449,17 @@ extension Ghostty { override func viewDidMoveToWindow() { guard let window = self.window else { return } guard let surface = self.surface else { return } - guard ghostty_surface_transparent(surface) else { return } - // Set the window transparency settings - window.isOpaque = false - window.hasShadow = false - window.backgroundColor = .clear + if ghostty_surface_transparent(surface) { + // Set the window transparency settings + window.isOpaque = false + window.hasShadow = false + window.backgroundColor = .clear + + // If we have a blur, set the blur + ghostty_set_window_background_blur(surface, Unmanaged.passUnretained(window).toOpaque()) + } - // If we have a blur, set the blur - ghostty_set_window_background_blur(surface, Unmanaged.passUnretained(window).toOpaque()) - // Try to set the initial window size if we have one setInitialWindowSize() }