Prevent cvpcb from losing text focus on filter

Refresh event changes focus (on GTK).  We fix this by storing the
existing insertion point in the text box, refocusing and restoring the
text position

Fixes https://gitlab.com/kicad/code/kicad/issues/10029

(cherry picked from commit 05d3dc533b)
This commit is contained in:
Seth Hillbrand 2022-01-06 09:15:13 -08:00
parent 0f0a540a65
commit 3ff87858de
1 changed files with 3 additions and 0 deletions

View File

@ -419,8 +419,11 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
// of available footprints which match the filter
long pos = m_tcFilterString->GetInsertionPoint();
wxListEvent l_event;
OnSelectComponent( l_event );
m_tcFilterString->SetFocus();
m_tcFilterString->SetInsertionPoint( pos );
}