diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 945a09e1a3..836cf40db8 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -448,11 +448,8 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) // clients that don't supply a tool will have to check GetSelected() themselves if( evt && m_tool ) { - wxLogTrace( kicadTraceToolStack, "ACTION_MENU::OnMenuEvent %s", evt->Format() ); - TOOL_MANAGER* toolMgr = m_tool->GetManager(); - // Pass the position the menu was opened from into the generated event if it is a select event if( type == wxEVT_COMMAND_MENU_SELECTED ) evt->SetMousePosition( g_menu_open_position ); @@ -462,16 +459,6 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) if( g_last_menu_highlighted_id == aEvent.GetId() && !m_isContextMenu ) evt->SetHasPosition( false ); - if( toolMgr->GetEditFrame() && !toolMgr->GetEditFrame()->GetDoImmediateActions() ) - { - // An tool-selection-event has no position - if( evt->GetCommandStr().is_initialized() - && evt->GetCommandStr().get() != toolMgr->GetEditFrame()->CurrentToolName() ) - { - evt->SetHasPosition( false ); - } - } - if( m_tool->GetManager() ) m_tool->GetManager()->ProcessEvent( *evt ); } diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index a04f03c37d..ca6544c2f1 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -1082,13 +1082,26 @@ bool TOOL_MANAGER::processEvent( const TOOL_EVENT& aEvent ) if( !handled ) { + TOOL_EVENT mod_event( aEvent ); + + // Only immediate actions get the position. Otherwise clear for tool activation + if( GetEditFrame() && !GetEditFrame()->GetDoImmediateActions() ) + { + // An tool-selection-event has no position + if( mod_event.GetCommandStr().is_initialized() + && mod_event.GetCommandStr().get() != GetEditFrame()->CurrentToolName() ) + { + mod_event.SetHasPosition( false ); + } + } + // If the event is not handled through a hotkey activation, pass it to the currently // running tool loops - handled |= dispatchInternal( aEvent ); - handled |= dispatchActivation( aEvent ); + handled |= dispatchInternal( mod_event ); + handled |= dispatchActivation( mod_event ); // Open the context menu if requested by a tool - DispatchContextMenu( aEvent ); + DispatchContextMenu( mod_event ); // Dispatch any remaining events in the event queue while( !m_eventQueue.empty() ) diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 18619ca8ad..25cbd9f0f7 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -481,6 +481,10 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType if( m_busUnfold.label ) m_selectionTool->AddItemToSel( m_busUnfold.label, true ); + // Continue the existing wires if we've started (usually by immediate action preference) + if( !m_wires.empty() ) + segment = m_wires.back(); + // Main loop: keep receiving events while( TOOL_EVENT* evt = Wait() ) {