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:
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user