The canvas should get the focus on clicks not the window

Fix #6308
This commit is contained in:
Marek Roszko 2020-11-06 00:37:05 -05:00
parent 08ca80a2d8
commit 9ed1ad06f7
1 changed files with 2 additions and 12 deletions

View File

@ -457,8 +457,8 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
if( isMouseClick( type ) )
{
if( holderWindow )
holderWindow->SetFocus();
if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() )
m_toolMgr->GetToolHolder()->GetToolCanvas()->SetFocus();
}
// Mouse handling
@ -497,16 +497,6 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
evt->SetMousePosition( pos );
}
}
#ifdef __APPLE__
// TODO That's a big ugly workaround, somehow DRAWPANEL_GAL loses focus
// after second LMB click and currently I have no means to do better debugging
if( type == wxEVT_LEFT_UP )
{
if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() )
m_toolMgr->GetToolHolder()->GetToolCanvas()->SetFocus();
}
#endif /* __APPLE__ */
}
else if( type == wxEVT_CHAR_HOOK || type == wxEVT_CHAR )
{