From 84c3c8fd8f5e9359196eb113e750455c39e59429 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 30 May 2022 18:51:44 +0200 Subject: [PATCH] avoid problem with disappearing modal child windows when dragged to a different space fixes #22242 --- src/osx/cocoa/nonownedwnd.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 5a0096287e..b1889c215a 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -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.