mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: fullscreen for windows without rounded corners (#47664)
This commit is contained in:
@@ -375,9 +375,6 @@ void SwizzleSwipeWithEvent(NSView* view, SEL swiz_selector) {
|
||||
}
|
||||
|
||||
- (BOOL)toggleFullScreenMode:(id)sender {
|
||||
if (!shell_->has_frame() && !shell_->HasStyleMask(NSWindowStyleMaskTitled))
|
||||
return NO;
|
||||
|
||||
bool is_simple_fs = shell_->IsSimpleFullScreen();
|
||||
bool always_simple_fs = shell_->always_simple_fullscreen();
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ class NativeWindowMac;
|
||||
int level_;
|
||||
bool is_resizable_;
|
||||
|
||||
bool is_borderless_;
|
||||
|
||||
// Whether the window is currently minimized. Used to work
|
||||
// around a macOS bug with child window minimization.
|
||||
bool is_minimized_;
|
||||
|
||||
@@ -299,6 +299,8 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
||||
- (void)windowWillEnterFullScreen:(NSNotification*)notification {
|
||||
// Store resizable mask so it can be restored after exiting fullscreen.
|
||||
is_resizable_ = shell_->HasStyleMask(NSWindowStyleMaskResizable);
|
||||
// Store borderless mask so it can be restored after exiting fullscreen.
|
||||
is_borderless_ = !shell_->HasStyleMask(NSWindowStyleMaskTitled);
|
||||
|
||||
shell_->set_is_transitioning_fullscreen(true);
|
||||
|
||||
@@ -306,6 +308,8 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
||||
|
||||
// Set resizable to true before entering fullscreen.
|
||||
shell_->SetResizable(true);
|
||||
// Set borderless to false before entering fullscreen.
|
||||
shell_->SetBorderless(false);
|
||||
}
|
||||
|
||||
- (void)windowDidEnterFullScreen:(NSNotification*)notification {
|
||||
@@ -341,6 +345,7 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
||||
shell_->set_is_transitioning_fullscreen(false);
|
||||
|
||||
shell_->SetResizable(is_resizable_);
|
||||
shell_->SetBorderless(is_borderless_);
|
||||
shell_->NotifyWindowLeaveFullScreen();
|
||||
|
||||
if (shell_->HandleDeferredClose())
|
||||
|
||||
Reference in New Issue
Block a user