7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 17:25:33 +00:00

Freeze ERC action before deleting

Each deletion of a marker adjusts the tree model and comes with a
possibility of a repaint, which can trigger a full screen repaint.
Keeping the dialog frozen prevents these updates

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19531
This commit is contained in:
Seth Hillbrand 2025-01-07 15:52:10 -08:00
parent ed12e1ee79
commit 5e4c5c969a
2 changed files with 6 additions and 0 deletions
eeschema/dialogs
pcbnew/dialogs

View File

@ -1010,12 +1010,16 @@ void DIALOG_ERC::OnSeverity( wxCommandEvent& aEvent )
void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions )
{
// Clear current selection list to avoid selection of deleted items
// Freeze to avoid repainting the dialog, which can cause a RePaint()
// of the screen as well
Freeze();
m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection );
m_markerTreeModel->DeleteItems( false, aIncludeExclusions, false );
SCH_SCREENS screens( m_parent->Schematic().Root() );
screens.DeleteAllMarkers( MARKER_BASE::MARKER_ERC, aIncludeExclusions );
Thaw();
}

View File

@ -1175,6 +1175,7 @@ void DIALOG_DRC::ExcludeMarker()
void DIALOG_DRC::deleteAllMarkers( bool aIncludeExclusions )
{
// Clear current selection list to avoid selection of deleted items
Freeze();
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_markersTreeModel->DeleteItems( false, aIncludeExclusions, false );
@ -1182,6 +1183,7 @@ void DIALOG_DRC::deleteAllMarkers( bool aIncludeExclusions )
m_fpWarningsTreeModel->DeleteItems( false, aIncludeExclusions, false );
m_frame->GetBoard()->DeleteMARKERs( true, aIncludeExclusions );
Thaw();
}