Try and reduce opportunity for lost keystrokes.
Fixes https://gitlab.com/kicad/code/kicad/issues/12445
This commit is contained in:
parent
3b94624e90
commit
d2712bac37
|
@ -429,8 +429,22 @@ void CVPCB_MAINFRAME::onTextFilterChanged( wxCommandEvent& event )
|
||||||
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
|
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
|
||||||
// of available footprints which match the filter
|
// of available footprints which match the filter
|
||||||
|
|
||||||
// GTK loses the search-control's focus when updating the footprints list box, so we record
|
if( !m_footprintListPendingUpdate )
|
||||||
// the insertion point here and then restore it (and the focus) at the end.
|
{
|
||||||
|
Bind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintListOnIdle, this );
|
||||||
|
m_footprintListPendingUpdate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CVPCB_MAINFRAME::updateFootprintListOnIdle( wxIdleEvent& aEvent )
|
||||||
|
{
|
||||||
|
Unbind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintListOnIdle, this );
|
||||||
|
m_footprintListPendingUpdate = false;
|
||||||
|
|
||||||
|
// GTK loses the search-control's focus on a Refresh event, so we record the focus and
|
||||||
|
// insertion point here and then restore them at the end.
|
||||||
|
bool searchCtrlHasFocus = m_tcFilterString->HasFocus();
|
||||||
long pos = m_tcFilterString->GetInsertionPoint();
|
long pos = m_tcFilterString->GetInsertionPoint();
|
||||||
|
|
||||||
COMPONENT* symbol = GetSelectedComponent();
|
COMPONENT* symbol = GetSelectedComponent();
|
||||||
|
@ -448,8 +462,11 @@ void CVPCB_MAINFRAME::onTextFilterChanged( wxCommandEvent& event )
|
||||||
|
|
||||||
DisplayStatus();
|
DisplayStatus();
|
||||||
|
|
||||||
m_tcFilterString->SetFocus();
|
if( searchCtrlHasFocus )
|
||||||
m_tcFilterString->SetInsertionPoint( pos );
|
{
|
||||||
|
m_tcFilterString->SetFocus();
|
||||||
|
m_tcFilterString->SetInsertionPoint( pos );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,8 @@ private:
|
||||||
|
|
||||||
void updateFootprintViewerOnIdle( wxIdleEvent& aEvent );
|
void updateFootprintViewerOnIdle( wxIdleEvent& aEvent );
|
||||||
|
|
||||||
|
void updateFootprintListOnIdle( wxIdleEvent& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the .equ files and populate the list of equivalents.
|
* Read the .equ files and populate the list of equivalents.
|
||||||
*
|
*
|
||||||
|
@ -394,6 +396,7 @@ private:
|
||||||
CVPCB_UNDO_REDO_LIST m_undoList;
|
CVPCB_UNDO_REDO_LIST m_undoList;
|
||||||
CVPCB_UNDO_REDO_LIST m_redoList;
|
CVPCB_UNDO_REDO_LIST m_redoList;
|
||||||
|
|
||||||
|
bool m_footprintListPendingUpdate;
|
||||||
bool m_viewerPendingUpdate;
|
bool m_viewerPendingUpdate;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue