Set proper level for modal dialogs of float-on-parent frames on wxOSX

This prevents the dialog from getting hidden behind its parent after
task switching the application into background and back to front.

Related to #4355, but not a fix.
This commit is contained in:
Lauri Nurmi
2017-02-10 13:44:23 +02:00
parent 8e47b3ca97
commit a9a980a71b

View File

@@ -812,8 +812,16 @@ bool wxNonOwnedWindowCocoaImpl::Show(bool show)
if ( parentView )
{
NSWindow* parentNSWindow = [parentView window];
if ( parentNSWindow )
if ( parentNSWindow ) {
[parentNSWindow addChildWindow:m_macWindow ordered:NSWindowAbove];
// If the parent is modal, windows with wxFRAME_FLOAT_ON_PARENT style need
// to be in kCGUtilityWindowLevel and not kCGFloatingWindowLevel to stay
// above the parent.
if ([m_macWindow level] == kCGFloatingWindowLevel) {
m_macWindowLevel = kCGUtilityWindowLevel;
[m_macWindow setLevel:m_macWindowLevel];
}
}
}
}