mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: avoid flicker when leaving fullscreen in frameless window (#27587)
This commit is contained in:
@@ -1490,11 +1490,6 @@ void NativeWindowMac::NotifyWindowEnterFullScreen() {
|
||||
void NativeWindowMac::NotifyWindowLeaveFullScreen() {
|
||||
NativeWindow::NotifyWindowLeaveFullScreen();
|
||||
exiting_fullscreen_ = false;
|
||||
// Add back buttonsView after leaving fullscreen mode.
|
||||
if (buttons_view_) {
|
||||
InternalSetStandardButtonsVisibility(false);
|
||||
[[window_ contentView] addSubview:buttons_view_];
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::NotifyWindowWillEnterFullScreen() {
|
||||
@@ -1507,9 +1502,12 @@ void NativeWindowMac::NotifyWindowWillEnterFullScreen() {
|
||||
}
|
||||
|
||||
void NativeWindowMac::NotifyWindowWillLeaveFullScreen() {
|
||||
// Hide window title after leaving fullscreen.
|
||||
if (buttons_view_)
|
||||
// Hide window title and restore buttonsView when leaving fullscreen.
|
||||
if (buttons_view_) {
|
||||
[window_ setTitleVisibility:NSWindowTitleHidden];
|
||||
InternalSetStandardButtonsVisibility(false);
|
||||
[[window_ contentView] addSubview:buttons_view_];
|
||||
}
|
||||
exiting_fullscreen_ = true;
|
||||
RedrawTrafficLights();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user