Browse Source

Fix double-click in footprint chooser.

Also fixes the assert when closing the chooser after the 3D
view was shown.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18107
pcb_db
Jeff Young 10 months ago
parent
commit
a3f69046ba
  1. 5
      3d-viewer/3d_canvas/eda_3d_canvas.h
  2. 12
      pcbnew/dialogs/dialog_footprint_chooser.cpp
  3. 5
      pcbnew/footprint_chooser_frame.cpp

5
3d-viewer/3d_canvas/eda_3d_canvas.h

@ -218,6 +218,8 @@ public:
*/
void DoRePaint();
void OnCloseWindow( wxCloseEvent& event );
private:
// The wxPaintEvent event. mainly calls DoRePaint()
void OnPaint( wxPaintEvent& aEvent );
@ -228,14 +230,13 @@ private:
void OnMouseWheel( wxMouseEvent& event );
void OnMagnify( wxMouseEvent& event );
void OnMagnify( wxMouseEvent& event );
void OnMouseMove( wxMouseEvent& event );
void OnLeftDown( wxMouseEvent& event );
void OnLeftUp( wxMouseEvent& event );
void OnMiddleUp( wxMouseEvent& event );
void OnMiddleDown( wxMouseEvent& event );
void OnTimerTimeout_Editing( wxTimerEvent& event );
void OnCloseWindow( wxCloseEvent& event );
void OnResize( wxSizeEvent& event );
void OnTimerTimeout_Redraw( wxTimerEvent& event );

12
pcbnew/dialogs/dialog_footprint_chooser.cpp

@ -62,12 +62,12 @@ DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER( PCB_BASE_FRAME* aParent,
// Accept handler
[this]()
{
EndModal( wxID_OK );
EndQuasiModal( wxID_OK );
},
// Escape handler
[this]()
{
EndModal( wxID_CANCEL );
EndQuasiModal( wxID_CANCEL );
} );
m_SizerTop->Add( m_chooserPanel, 1, wxEXPAND | wxRIGHT, 5 );
@ -303,4 +303,12 @@ void DIALOG_FOOTPRINT_CHOOSER::TearDownQuasiModal()
}
}
}
if( m_preview3DCanvas )
{
// Work around assertion firing when we try to LockCtx on a hidden 3D canvas during dtor
wxCloseEvent dummy;
m_preview3DCanvas->Show();
m_preview3DCanvas->OnCloseWindow( dummy );
}
}

5
pcbnew/footprint_chooser_frame.cpp

@ -199,6 +199,11 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare
FOOTPRINT_CHOOSER_FRAME::~FOOTPRINT_CHOOSER_FRAME()
{
// Work around assertion firing when we try to LockCtx on a hidden 3D canvas during dtor
wxCloseEvent dummy;
m_preview3DCanvas->Show();
m_preview3DCanvas->OnCloseWindow( dummy );
// Disconnect Events
m_grButton3DView->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::on3DviewReq ),

Loading…
Cancel
Save