pcbnew: Update focus in browser

When we refresh a scrolled window to get the GTK scrollbars updated, we
can capture the mouse, making key-only scrolling difficult when we want
the window not focused.  This resets the active focus after refresh.

Fixes: lp:1841565
* https://bugs.launchpad.net/kicad/+bug/1841565
This commit is contained in:
Seth Hillbrand 2019-08-27 07:28:51 -07:00
parent 9dac8534c1
commit d0adaf1efd
1 changed files with 8 additions and 0 deletions

View File

@ -473,10 +473,18 @@ void FOOTPRINT_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
}
else if( aEvent.GetKeyCode() == WXK_DOWN )
{
// Need to reset the focus after selection due to GTK mouse-refresh
// that captures the mouse into the canvas to update scrollbars
if( m_libFilter->HasFocus() )
{
selectNext( m_libList );
m_libFilter->SetFocus();
}
else
{
selectNext( m_fpList );
m_fpList->SetFocus();
}
}
else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
{