fix: paint and flash issues on macOS (#46629)
This commit is contained in:
parent
e825107f8a
commit
339e0040ef
6 changed files with 57 additions and 6 deletions
|
@ -47,7 +47,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
|
|||
// Copy the show setting to webContents, but only if we don't want to paint
|
||||
// when initially hidden
|
||||
bool paint_when_initially_hidden = true;
|
||||
options.Get("paintWhenInitiallyHidden", &paint_when_initially_hidden);
|
||||
options.Get(options::kPaintWhenInitiallyHidden, &paint_when_initially_hidden);
|
||||
if (!paint_when_initially_hidden) {
|
||||
bool show = true;
|
||||
options.Get(options::kShow, &show);
|
||||
|
|
|
@ -154,6 +154,9 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
bool hiddenInMissionControl = false;
|
||||
options.Get(options::kHiddenInMissionControl, &hiddenInMissionControl);
|
||||
|
||||
bool paint_when_initially_hidden = true;
|
||||
options.Get(options::kPaintWhenInitiallyHidden, &paint_when_initially_hidden);
|
||||
|
||||
// The window without titlebar is treated the same with frameless window.
|
||||
if (title_bar_style_ != TitleBarStyle::kNormal)
|
||||
set_has_frame(false);
|
||||
|
@ -194,8 +197,8 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
params.bounds = bounds;
|
||||
params.delegate = this;
|
||||
params.type = views::Widget::InitParams::TYPE_WINDOW;
|
||||
// Allow painting before shown, to be later disabled in ElectronNSWindow.
|
||||
params.headless_mode = true;
|
||||
// Possibly allow painting before shown - later disabled in ElectronNSWindow.
|
||||
params.headless_mode = paint_when_initially_hidden;
|
||||
if (IsTranslucent()) {
|
||||
params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue