avoid problem with disappearing modal child windows when dragged to a different space

fixes #22242
This commit is contained in:
Stefan Csomor 2022-05-30 18:51:44 +02:00
parent 6ce81acda8
commit 84c3c8fd8f

View File

@ -956,7 +956,10 @@ bool wxNonOwnedWindowCocoaImpl::Show(bool show)
{
NSWindow* parentNSWindow = [parentView window];
if ( parentNSWindow ) {
[parentNSWindow addChildWindow:m_macWindow ordered:NSWindowAbove];
// we used to call [parentNSWindow addChildWindow:m_macWindow here
// but this lead to problems with Spaces (modal windows disappeared
// when dragged to a different space)
// If the parent is modal, windows with wxFRAME_FLOAT_ON_PARENT style need
// to be in NSModalPanelWindowLevel and not NSFloatingWindowLevel to stay
// above the parent.