From 85ea10e59aee3d051322747409ddcf8d79d51b2b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 24 Feb 2026 12:13:25 +0000 Subject: [PATCH] Clear flags on duplicate, save as, etc. Fixes https://gitlab.com/kicad/code/kicad/-/issues/23138 --- pcbnew/footprint_libraries_utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index 1f2fdd251f..6a370a6b35 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -820,6 +820,14 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary( FOOTPRINT* aFootprint, { aFootprint->SetFPID( LIB_ID( wxEmptyString, aFootprint->GetFPID().GetLibItemName() ) ); + // Clear selected, brightened, temp flags, edit flags, the whole shebang. + aFootprint->RunOnChildren( + []( BOARD_ITEM* child ) + { + child->ClearFlags(); + }, + RECURSE_MODE::RECURSE ); + FOOTPRINT_LIBRARY_ADAPTER* adapter = PROJECT_PCB::FootprintLibAdapter( &Prj() ); adapter->SaveFootprint( aLibraryName, aFootprint );