From 8e4098f3f153404d8118b64e5e62fb4edf5817f5 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 27 May 2016 16:51:23 -0400 Subject: [PATCH] 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. --- cvpcb/class_footprints_listbox.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cvpcb/class_footprints_listbox.cpp b/cvpcb/class_footprints_listbox.cpp index ae611e43a7..78ce524270 100644 --- a/cvpcb/class_footprints_listbox.cpp +++ b/cvpcb/class_footprints_listbox.cpp @@ -199,11 +199,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()->GetFpViewerFrame() ) GetParent()->CreateScreenCmp(); GetParent()->DisplayStatus(); + + if( hasFocus ) + SetFocus(); }