diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 94fcbdac1e..843b639bd3 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -882,6 +882,9 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) } else if( evt->IsClick( BUT_RIGHT ) ) { + if( !text ) + m_toolMgr->VetoContextMenuMouseWarp(); + m_menu.ShowContextMenu( selection() ); } else if( evt->IsClick( BUT_LEFT ) ) @@ -1179,6 +1182,9 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) } else if( evt->IsClick( BUT_RIGHT ) ) { + if( !dimension ) + m_toolMgr->VetoContextMenuMouseWarp(); + m_menu.ShowContextMenu( selection() ); } else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) ) @@ -1976,6 +1982,9 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, } else if( evt->IsClick( BUT_RIGHT ) ) { + if( !graphic ) + m_toolMgr->VetoContextMenuMouseWarp(); + m_menu.ShowContextMenu( selection() ); } else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) ) @@ -2411,6 +2420,9 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, } else if( evt->IsClick( BUT_RIGHT ) ) { + if( !graphic ) + m_toolMgr->VetoContextMenuMouseWarp(); + m_menu.ShowContextMenu( selection() ); } else if( evt->IsAction( &PCB_ACTIONS::incWidth ) ) @@ -2663,6 +2675,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) } else if( evt->IsClick( BUT_RIGHT ) ) { + if( !started ) + m_toolMgr->VetoContextMenuMouseWarp(); + m_menu.ShowContextMenu( selection() ); } // events that lock in nodes diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index 5ce316dff0..da911ebe06 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -675,6 +675,10 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit restore_state = true; // Canceling the tool means that items have to be restored break; // Finish } + else if( evt->IsClick( BUT_RIGHT ) ) + { + m_menu.ShowContextMenu( selection ); + } else if( evt->IsAction( &ACTIONS::undo ) || evt->IsAction( &ACTIONS::doDelete ) ) { restore_state = true; // Perform undo locally diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 850d9aaaa6..4c9e11336c 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -348,7 +348,10 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->ForceRefresh(); if( !selectionCancelled ) + { + m_toolMgr->VetoContextMenuMouseWarp(); m_menu.ShowContextMenu( m_selection ); + } } else if( evt->IsDblClick( BUT_LEFT ) ) {