fix: zombie windows when fullscreening and closing (#34378)
This commit is contained in:
parent
93b39b92b5
commit
2cb53c5db1
4 changed files with 46 additions and 5 deletions
|
@ -474,6 +474,11 @@ void NativeWindowMac::Close() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (fullscreen_transition_state() != FullScreenTransitionState::NONE) {
|
||||
SetHasDeferredWindowClose(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// If a sheet is attached to the window when we call
|
||||
// [window_ performClose:nil], the window won't close properly
|
||||
// even after the user has ended the sheet.
|
||||
|
@ -678,6 +683,15 @@ void NativeWindowMac::HandlePendingFullscreenTransitions() {
|
|||
SetFullScreen(next_transition);
|
||||
}
|
||||
|
||||
bool NativeWindowMac::HandleDeferredClose() {
|
||||
if (has_deferred_window_close_) {
|
||||
SetHasDeferredWindowClose(false);
|
||||
Close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetFullScreen(bool fullscreen) {
|
||||
// [NSWindow -toggleFullScreen] is an asynchronous operation, which means
|
||||
// that it's possible to call it while a fullscreen transition is currently
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue