Cvpcb: fix a focus issue (on OSX), when using arrow keys to scroll the footprint list box, if the footprint and 3D viewers are opened.

This commit is contained in:
jean-pierre charras 2016-05-27 18:15:16 +02:00
parent ade1d1fe74
commit 4441a4b4c7
1 changed files with 9 additions and 0 deletions

View File

@ -215,11 +215,20 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
if( m_footprintList.IsEmpty() )
return;
// On some plateforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
// are opened and refreshed when a new footprint is selected.
// If the listbox has the focus before selecting a new footprint, it will be forced
// after selection.
bool hasFocus = HasFocus();
// If the footprint view window is displayed, update the footprint.
if( GetParent()->GetFootprintViewerFrame() )
GetParent()->CreateScreenCmp();
GetParent()->DisplayStatus();
if( hasFocus )
SetFocus();
}