diff --git a/pcbnew/tools/global_edit_tool.cpp b/pcbnew/tools/global_edit_tool.cpp index 4e6d674f22..0d93aa85b7 100644 --- a/pcbnew/tools/global_edit_tool.cpp +++ b/pcbnew/tools/global_edit_tool.cpp @@ -58,11 +58,17 @@ bool GLOBAL_EDIT_TOOL::Init() int GLOBAL_EDIT_TOOL::ExchangeFootprints( const TOOL_EVENT& aEvent ) { - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( EDIT_TOOL::FootprintFilter ); - MODULE* mod = (selection.Empty() ? nullptr : selection.FirstOfKind () ); + PCBNEW_SELECTION& selection = m_selectionTool->GetSelection(); + MODULE* mod = nullptr; bool updateMode = false; bool currentMode = false; + if( aEvent.HasPosition() ) + selection = m_selectionTool->RequestSelection( EDIT_TOOL::FootprintFilter ); + + if( !selection.Empty() ) + mod = selection.FirstOfKind(); + if( aEvent.IsAction( &PCB_ACTIONS::updateFootprint ) ) { updateMode = true;