diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index eb72a49fd6..08eb9e36a0 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -830,6 +830,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer ) if( IsGalCanvasActive() ) { m_toolManager->RunAction( COMMON_ACTIONS::layerChanged ); // notify other tools + GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere GetGalCanvas()->Refresh(); } } diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 4dc89ddebb..a77d5e32b5 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -532,9 +532,7 @@ void ROUTER_TOOL::performRouting() } m_router->SwitchLayer( m_startLayer ); - frame->SetActiveLayer( ToLAYER_ID( m_startLayer ) ); - frame->GetGalCanvas()->SetFocus(); if( m_startItem && m_startItem->Net() >= 0 ) highlightNet( true, m_startItem->Net() ); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 537b051bed..1bbddbc432 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -298,7 +298,6 @@ int PCBNEW_CONTROL::LayerSwitch( TOOL_EVENT& aEvent ) else if( aEvent.IsAction( &COMMON_ACTIONS::layerBottom ) ) m_frame->SwitchLayer( NULL, B_Cu ); - m_frame->GetGalCanvas()->SetFocus(); setTransitions(); return 0; @@ -325,8 +324,8 @@ int PCBNEW_CONTROL::LayerNext( TOOL_EVENT& aEvent ) else ++layer; + assert( IsCopperLayer( layer ) ); editFrame->SwitchLayer( NULL, ToLAYER_ID( layer ) ); - editFrame->GetGalCanvas()->SetFocus(); setTransitions(); return 0; @@ -355,7 +354,6 @@ int PCBNEW_CONTROL::LayerPrev( TOOL_EVENT& aEvent ) assert( IsCopperLayer( layer ) ); editFrame->SwitchLayer( NULL, ToLAYER_ID( layer ) ); - editFrame->GetGalCanvas()->SetFocus(); setTransitions(); return 0;