fix: end attached sheet when calling window.hide() (#28694)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2021-04-21 11:20:31 +02:00
committed by GitHub
parent 1937aff793
commit ed7f5f3a0b

View File

@@ -535,6 +535,12 @@ void NativeWindowMac::ShowInactive() {
}
void NativeWindowMac::Hide() {
// If a sheet is attached to the window when we call [window_ orderOut:nil],
// the sheet won't be able to show again on the same window.
// Ensure it's closed before calling [window_ orderOut:nil].
if ([window_ attachedSheet])
[window_ endSheet:[window_ attachedSheet]];
if (is_modal() && parent()) {
[window_ orderOut:nil];
[parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_];