fix: close all open sheets before closing window on macOS (#43954)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: John Beutner <beutner.john@gmail.com>
This commit is contained in:
parent
497ecca01e
commit
5e32d32913
2 changed files with 12 additions and 1 deletions
|
@ -347,8 +347,11 @@ void NativeWindowMac::Close() {
|
|||
// [window_ performClose:nil], the window won't close properly
|
||||
// even after the user has ended the sheet.
|
||||
// Ensure it's closed before calling [window_ performClose:nil].
|
||||
if ([window_ attachedSheet])
|
||||
// If multiple sheets are open, they must all be closed.
|
||||
while ([window_ attachedSheet]) {
|
||||
[window_ endSheet:[window_ attachedSheet]];
|
||||
}
|
||||
DCHECK_EQ([[window_ sheets] count], 0UL);
|
||||
|
||||
// window_ could be nil after performClose.
|
||||
bool should_notify = is_modal() && parent() && IsVisible();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue