refactor: simplify NativeWindow::FullScreenTransitionState (#46918)

* refactor: make NativeWindow::fullscreen_transition_state_ private

* refactor: add NativeWindow::is_transitioning_fullscreen() helper

* refactor: remove unused NativeWindow::fullscreen_transition_state()

* refactor: replace NativeWindow::set_fullscreen_transition_state() with NativeWindow::set_is_transitioning_fullscreen()

refactor: remove unused NativeWindow::FullScreenTransitionState
This commit is contained in:
Charles Kerr
2025-05-05 09:28:29 -05:00
committed by GitHub
parent 1f4f1b4afc
commit 2e2776611f
4 changed files with 18 additions and 25 deletions

View File

@@ -18,8 +18,6 @@
#include "ui/views/widget/native_widget_mac.h"
using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
using FullScreenTransitionState =
electron::NativeWindow::FullScreenTransitionState;
@implementation ElectronNSWindowDelegate
@@ -302,7 +300,7 @@ using FullScreenTransitionState =
// Store resizable mask so it can be restored after exiting fullscreen.
is_resizable_ = shell_->HasStyleMask(NSWindowStyleMaskResizable);
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kEntering);
shell_->set_is_transitioning_fullscreen(true);
shell_->NotifyWindowWillEnterFullScreen();
@@ -311,7 +309,7 @@ using FullScreenTransitionState =
}
- (void)windowDidEnterFullScreen:(NSNotification*)notification {
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kNone);
shell_->set_is_transitioning_fullscreen(false);
shell_->NotifyWindowEnterFullScreen();
@@ -322,7 +320,7 @@ using FullScreenTransitionState =
}
- (void)windowDidFailToEnterFullScreen:(NSWindow*)window {
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kNone);
shell_->set_is_transitioning_fullscreen(false);
shell_->SetResizable(is_resizable_);
shell_->NotifyWindowDidFailToEnterFullScreen();
@@ -334,13 +332,13 @@ using FullScreenTransitionState =
}
- (void)windowWillExitFullScreen:(NSNotification*)notification {
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kExiting);
shell_->set_is_transitioning_fullscreen(true);
shell_->NotifyWindowWillLeaveFullScreen();
}
- (void)windowDidExitFullScreen:(NSNotification*)notification {
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kNone);
shell_->set_is_transitioning_fullscreen(false);
shell_->SetResizable(is_resizable_);
shell_->NotifyWindowLeaveFullScreen();