fix: handle failing to enter fullscreen on macOS (#43152)

* fix: handle failing to enter/exit fullscreen on macOS

On macOS, failing to enter/exit fullscreen can fail. If this happens,
properly restore the original window state.

Co-authored-by: cptpcrd <31829097+cptpcrd@users.noreply.github.com>

* refactor: remove fail to exit fullscreen handlers

Seem to be unnecessary since the window exits fullscreen anyway.

Co-authored-by: cptpcrd <31829097+cptpcrd@users.noreply.github.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: cptpcrd <31829097+cptpcrd@users.noreply.github.com>
This commit is contained in:
trop[bot] 2024-08-01 14:50:35 +02:00 committed by GitHub
parent 54c8036c71
commit 341ed10854
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View file

@ -311,6 +311,18 @@ using FullScreenTransitionState =
shell_->HandlePendingFullscreenTransitions();
}
- (void)windowDidFailToEnterFullScreen:(NSWindow*)window {
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kNone);
shell_->SetResizable(is_resizable_);
shell_->NotifyWindowDidFailToEnterFullScreen();
if (shell_->HandleDeferredClose())
return;
shell_->HandlePendingFullscreenTransitions();
}
- (void)windowWillExitFullScreen:(NSNotification*)notification {
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kExiting);