Skip to content

Commit b8162be

Browse files
authored
fix: disable animation for win.setSimpleFullScreen (electron#19143)
1 parent 47f5fe6 commit b8162be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

atom/browser/native_window_mac.mm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,13 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
952952
[[window standardWindowButton:NSWindowCloseButton] setHidden:YES];
953953
}
954954

955-
[window setFrame:fullscreenFrame display:YES animate:YES];
955+
// There is a bug with Chromium that, after setting window style, calling
956+
// setFrame with animation immediately would block window rendering for
957+
// a few seconds.
958+
// This Chromium bug is fixed in later versions, but it is hard to find
959+
// out how to backport the fix or how to work around it, disabling the
960+
// animation is the easist fix and most users would not even notice it.
961+
[window setFrame:fullscreenFrame display:YES animate:NO];
956962

957963
// Fullscreen windows can't be resized, minimized, maximized, or moved
958964
SetMinimizable(false);
@@ -976,7 +982,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
976982
[[window standardWindowButton:NSWindowCloseButton]
977983
setHidden:window_button_hidden];
978984

979-
[window setFrame:original_frame_ display:YES animate:YES];
985+
[window setFrame:original_frame_ display:YES animate:NO];
980986
window.level = original_level_;
981987

982988
[NSApp setPresentationOptions:simple_fullscreen_options_];

0 commit comments

Comments
 (0)