From 3ff87858de739ebc3edcbf7aef4866030c070238 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 6 Jan 2022 09:15:13 -0800 Subject: [PATCH] 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 05d3dc533b9748b23ecc0c43aa9a9113c0e4608b) --- cvpcb/cvpcb_mainframe.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index c63d760c69..0b3b276e6d 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -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 ); }