diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index c45aab1e92..ca04263dc1 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -571,7 +572,17 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( SCH_EDIT_FRAME* schframe = dynamic_cast( m_frame ) ) schframe->FocusOnItem( nullptr ); - ClearSelection(); + if( !GetSelection().Empty() ) + { + ClearSelection(); + } + else if( evt->FirstResponder() == this ) + { + SCH_EDITOR_CONTROL* editor = m_toolMgr->GetTool(); + + if( editor ) + editor->ClearHighlight( *evt ); + } } else if( evt->Action() == TA_UNDO_REDO_PRE ) { @@ -580,7 +591,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) ClearSelection(); } - else if( evt->IsMotion() && !m_isSymbolEditor && m_frame->ToolStackIsEmpty() ) + else if( evt->IsMotion() && !m_isSymbolEditor && evt->FirstResponder() == this ) { // Update cursor and rollover item rolloverItem = niluuid;