Cleanup/downscope variable

This commit is contained in:
Marek Roszko 2020-11-06 00:38:36 -05:00
parent 9ed1ad06f7
commit 05b5d2de00
1 changed files with 1 additions and 2 deletions

View File

@ -434,14 +434,13 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
wxEventType type = aEvent.GetEventType();
wxWindow* holderWindow = dynamic_cast<wxWindow*>( m_toolMgr->GetToolHolder() );
// Sometimes there is no window that has the focus (it happens when another PCB_BASE_FRAME
// is opened and is iconized on Windows).
// In this case, give the focus to the parent frame (GAL canvas itself does not accept the
// focus when iconized for some obscure reason)
if( focus == nullptr )
{
wxWindow* holderWindow = dynamic_cast<wxWindow*>( m_toolMgr->GetToolHolder() );
#if defined( _WIN32 )
// Mouse events may trigger regardless of window status (windows feature)