fix: zombie windows when fullscreening and closing (#34378)

This commit is contained in:
Shelley Vohr 2022-05-31 10:43:42 +02:00 committed by GitHub
parent 93b39b92b5
commit 2cb53c5db1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions

View file

@ -176,6 +176,10 @@ class NativeWindowMac : public NativeWindow,
// Handle fullscreen transitions.
void SetFullScreenTransitionState(FullScreenTransitionState state);
void HandlePendingFullscreenTransitions();
bool HandleDeferredClose();
void SetHasDeferredWindowClose(bool defer_close) {
has_deferred_window_close_ = defer_close;
}
enum class VisualEffectState {
kFollowWindow,
@ -249,6 +253,12 @@ class NativeWindowMac : public NativeWindow,
FullScreenTransitionState fullscreen_transition_state_ =
FullScreenTransitionState::NONE;
// Trying to close an NSWindow during a fullscreen transition will cause the
// window to lock up. Use this to track if CloseWindow was called during a
// fullscreen transition, to defer the -[NSWindow close] call until the
// transition is complete.
bool has_deferred_window_close_ = false;
NSInteger attention_request_id_ = 0; // identifier from requestUserAttention
// The presentation options before entering kiosk mode.