diff --git a/common/tool/selection_tool.cpp b/common/tool/selection_tool.cpp index ed1178d4d9..d05fb79974 100644 --- a/common/tool/selection_tool.cpp +++ b/common/tool/selection_tool.cpp @@ -217,6 +217,10 @@ void SELECTION_TOOL::onDisambiguationExpire( wxTimerEvent& aEvent ) if( selection().GetSize() >= 2 ) return; + // If another tool has since started running then we don't want to interrupt + if( !getEditFrame()->ToolStackIsEmpty() ) + return; + m_toolMgr->ProcessEvent( EVENTS::DisambiguatePoint ); } diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index 4a79ec86ba..d452c4a5fb 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -49,6 +49,7 @@ SCH_MOVE_TOOL::SCH_MOVE_TOOL() : EE_TOOL_BASE( "eeschema.InteractiveMove" ), + m_inMoveTool( false ), m_moveInProgress( false ), m_isDrag( false ), m_moveOffset( 0, 0 ) @@ -400,6 +401,11 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) return 0; } + if( m_inMoveTool ) // Must come after m_moveInProgress checks above... + return 0; + + REENTRANCY_GUARD guard( &m_inMoveTool ); + // Be sure that there is at least one item that we can move. If there's no selection try // looking for the stuff under mouse cursor (i.e. Kicad old-style hover selection). EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::MovableItems ); diff --git a/eeschema/tools/sch_move_tool.h b/eeschema/tools/sch_move_tool.h index 0112b6947e..e8a4e55903 100644 --- a/eeschema/tools/sch_move_tool.h +++ b/eeschema/tools/sch_move_tool.h @@ -84,6 +84,9 @@ private: void setTransitions() override; private: + ///< Re-entrancy guard + bool m_inMoveTool; + ///< Flag determining if anything is being dragged right now bool m_moveInProgress; bool m_isDrag;