fix: end attached sheet when calling window.hide() (#28671)
This commit is contained in:
parent
a354c95d4c
commit
484931bba2
1 changed files with 6 additions and 0 deletions
|
@ -537,6 +537,12 @@ void NativeWindowMac::ShowInactive() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::Hide() {
|
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()) {
|
if (is_modal() && parent()) {
|
||||||
[window_ orderOut:nil];
|
[window_ orderOut:nil];
|
||||||
[parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_];
|
[parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_];
|
||||||
|
|
Loading…
Reference in a new issue