From 2d389424aff9a06a8df76d595e2fc362be3f4df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B3=A0=E9=9F=B3?= Date: Tue, 21 Jul 2026 12:36:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(macos):=20=F0=9F=90=9B=20restore=20opaque?= =?UTF-8?q?=20window=20background=20for=20title=20bar=20(#2448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the first-frame-ready show flow from #1287, but stop clearing the native window background so the macOS title bar no longer appears transparent. Co-authored-by: Wine Fox --- macos/Runner/MainFlutterWindow.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift index 46208ccb1..95e810b71 100644 --- a/macos/Runner/MainFlutterWindow.swift +++ b/macos/Runner/MainFlutterWindow.swift @@ -9,9 +9,9 @@ class MainFlutterWindow: NSWindow { self.contentViewController = flutterViewController self.setFrame(self.frame, display: true) - // 背景别用默认黑色 - self.isOpaque = false - self.backgroundColor = .clear + // 使用系统窗口背景色,避免启动防闪时把标题栏/窗口背景透成透明 + self.isOpaque = true + self.backgroundColor = .windowBackgroundColor RegisterGeneratedPlugins(registry: flutterViewController)