diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 9d1107a1ce..9426c4714c 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -658,25 +658,21 @@ void FOOTPRINT_VIEWER_FRAME::Show3D_Frame( wxCommandEvent& event ) { EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame(); + // We can probably remove this for 6.0, but just to be safe we'll stick to + // one 3DFrame at a time for 5.0 if( draw3DFrame ) - { - // Raising the window does not show the window on Windows if iconized. - // This should work on any platform. - if( draw3DFrame->IsIconized() ) - draw3DFrame->Iconize( false ); + draw3DFrame->Close( true ); - draw3DFrame->Raise(); - - // Raising the window does not set the focus on Linux. This should work on any platform. - if( wxWindow::FindFocus() != draw3DFrame ) - draw3DFrame->SetFocus(); - - return; - } - - draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, wxEmptyString ); + draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) ); Update3D_Frame( false ); + +#ifdef __WXMAC__ + // A stronger version of Raise() which promotes the window to its parent's level. + draw3DFrame->ReparentQuasiModal(); +#else draw3DFrame->Raise(); // Needed with some Window Managers +#endif + draw3DFrame->Show( true ); } diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 413ec5b138..8b8be2ad4c 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -609,25 +609,21 @@ void FOOTPRINT_WIZARD_FRAME::Show3D_Frame( wxCommandEvent& event ) { EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame(); + // We can probably remove this for 6.0, but just to be safe we'll stick to + // one 3DFrame at a time for 5.0 if( draw3DFrame ) - { - // Raising the window does not show the window on Windows if iconized. - // This should work on any platform. - if( draw3DFrame->IsIconized() ) - draw3DFrame->Iconize( false ); + draw3DFrame->Close( true ); - draw3DFrame->Raise(); - - // Raising the window does not set the focus on Linux. This should work on any platform. - if( wxWindow::FindFocus() != draw3DFrame ) - draw3DFrame->SetFocus(); - - return; - } - - draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, wxEmptyString ); + draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) ); Update3D_Frame( false ); + +#ifdef __WXMAC__ + // A stronger version of Raise() which promotes the window to its parent's level. + draw3DFrame->ReparentQuasiModal(); +#else draw3DFrame->Raise(); // Needed with some Window Managers +#endif + draw3DFrame->Show( true ); }