Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX: Fix a couple of minimized WindowState bugs #6407

Merged
merged 3 commits into from
Aug 16, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions native/Avalonia.Native/src/OSX/window.mm
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,12 @@ virtual HRESULT SetParent (IAvnWindow* parent) override
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();
Expand Down Expand Up @@ -1204,6 +1210,7 @@ virtual HRESULT SetWindowState (AvnWindowState state) override
}

_actualWindowState = _lastWindowState;
WindowEvents->WindowStateChanged(_actualWindowState);
}


Expand Down