diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 81fbdb7c8e..4a8ec0a326 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -186,6 +187,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a { view->Remove( boardItem ); + // Removing an item should trigger the unselect + m_toolMgr->RunAction( PCB_ACTIONS::unselectItem, true, boardItem ); + if( !( changeFlags & CHT_DONE ) ) { MODULE* module = static_cast( boardItem->GetParent() ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index c6a4f9920b..e0d13f48c5 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -676,24 +676,22 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) // Display properties dialog BOARD_ITEM* item = static_cast( selection.Front() ); - // Some of properties dialogs alter pointers, so we should deselect them - m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - - // Store flags, so they can be restored later - STATUS_FLAGS flags = item->GetFlags(); - item->ClearFlags(); - // Do not handle undo buffer, it is done by the properties dialogs @todo LEGACY // Display properties dialog provided by the legacy canvas frame editFrame->OnEditItemRequest( NULL, item ); + // Notify other tools of the changes m_toolMgr->RunAction( PCB_ACTIONS::selectionModified, true ); - item->SetFlags( flags ); } if( selection.IsHover() ) + { m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + // Notify other tools of the changes -- This updates the visual ratsnest + m_toolMgr->RunAction( PCB_ACTIONS::selectionModified, true ); + } + return 0; }