mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 23:23:47 +00:00
ReparentModal: fix case when parent is not available
In some situations then parent window couldn't be available. Eg, when eeschema is executed as standalone on macOS and trying to show the global design block table dialog before the main frame exists. So replace the assert with return and check the windows pointers bellow.
This commit is contained in:
parent
59759b325f
commit
20ee4effdc
@ -81,12 +81,19 @@ void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
|
||||
wxTopLevelWindow* parent =
|
||||
static_cast<wxTopLevelWindow*>( wxGetTopLevelParent( aWindow->GetParent() ) );
|
||||
|
||||
wxASSERT_MSG(parent, wxT( "Modal windows require a parent.") );
|
||||
// Quietly return if no parent is found
|
||||
if( !parent )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NSWindow* parentWindow = parent->GetWXWindow();
|
||||
NSWindow* theWindow = aWindow->GetWXWindow();
|
||||
|
||||
[parentWindow addChildWindow:theWindow ordered:NSWindowAbove];
|
||||
if( parentWindow && theWindow )
|
||||
{
|
||||
[parentWindow addChildWindow:theWindow ordered:NSWindowAbove];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user