From 17487df08d366275fc36de65f7747e2488f39ffd Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 10:35:27 +0200 Subject: [PATCH] fix: flicker and ghosting in transparent windows on macOS (#46393) * fix: transparent flicker on MAS Co-authored-by: clavin * Gate condition on `IsTranslucent` instead Co-authored-by: clavin --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: clavin --- shell/browser/native_window_mac.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 37ff7da6d62..dbeceb836ea 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -196,6 +196,9 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, params.type = views::Widget::InitParams::TYPE_WINDOW; // Allow painting before shown, to be later disabled in ElectronNSWindow. params.headless_mode = true; + if (IsTranslucent()) { + params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent; + } params.native_widget = new ElectronNativeWidgetMac(this, windowType, styleMask, widget()); widget()->Init(std::move(params));