Browse Source
End/close AppKit sheets attached on window when we hide it (#17968)
pull/17406/head
Maxwell Katz
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
13 additions and
0 deletions
-
native/Avalonia.Native/src/OSX/WindowBaseImpl.mm
|
|
|
@ -143,6 +143,19 @@ HRESULT WindowBaseImpl::Hide() { |
|
|
|
|
|
|
|
@autoreleasepool { |
|
|
|
if (Window != nullptr) { |
|
|
|
|
|
|
|
// If window is hidden without ending attached sheet first, it will stuck in "order out" state, |
|
|
|
// and block any new sheets from being attached. |
|
|
|
// Additionaly, we don't know if user would define any custom panels, so we only end/close file dialog sheets. |
|
|
|
auto attachedSheet = Window.attachedSheet; |
|
|
|
if (attachedSheet |
|
|
|
&& ([attachedSheet isKindOfClass: [NSOpenPanel class]] |
|
|
|
|| [attachedSheet isKindOfClass: [NSSavePanel class]])) |
|
|
|
{ |
|
|
|
[Window endSheet:attachedSheet]; |
|
|
|
[attachedSheet close]; |
|
|
|
} |
|
|
|
|
|
|
|
auto frame = [Window frame]; |
|
|
|
|
|
|
|
AvnPoint point; |
|
|
|
|