fix: flicker and ghosting in transparent windows on macOS (#46353)

* fix: transparent flicker on MAS

* Gate condition on `IsTranslucent` instead
This commit is contained in:
Calvin 2025-03-31 17:12:35 -06:00 committed by GitHub
parent 09135443a0
commit 1730062c8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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));