diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 5c9113fbba..f45fb01863 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -313,6 +313,13 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) int type = aEvent.GetEventType(); + // Sometimes there is no window that has the focus (it happens when an other PCB_BASE_FRAME + // is opened and is iconized on Windows). + // In this case, gives the focus to the parent PCB_BASE_FRAME (for an obscure reason, + // when happens, the GAL canvas itself does not accept the focus) + if( wxWindow::FindFocus() == nullptr ) + static_cast( m_toolMgr->GetEditFrame() )->SetFocus(); + // Mouse handling // Note: wxEVT_LEFT_DOWN event must always be skipped. if( type == wxEVT_MOTION || type == wxEVT_MOUSEWHEEL ||