Browse Source
Merge pull request #6407 from AvaloniaUI/fixes/6399-osx-minimized-state
OSX: Fix a couple of minimized WindowState bugs
pull/6429/head
Dan Walmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
native/Avalonia.Native/src/OSX/window.mm
|
|
|
@ -713,6 +713,12 @@ private: |
|
|
|
if(cparent == nullptr) |
|
|
|
return E_INVALIDARG; |
|
|
|
|
|
|
|
// If one tries to show a child window with a minimized parent window, then the parent window will be |
|
|
|
// restored but MacOS isn't kind enough to *tell* us that, so the window will be left in a non-interactive |
|
|
|
// state. Detect this and explicitly restore the parent window ourselves to avoid this situation. |
|
|
|
if (cparent->WindowState() == Minimized) |
|
|
|
cparent->SetWindowState(Normal); |
|
|
|
|
|
|
|
[cparent->Window addChildWindow:Window ordered:NSWindowAbove]; |
|
|
|
|
|
|
|
UpdateStyle(); |
|
|
|
@ -1204,6 +1210,7 @@ private: |
|
|
|
} |
|
|
|
|
|
|
|
_actualWindowState = _lastWindowState; |
|
|
|
WindowEvents->WindowStateChanged(_actualWindowState); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|