diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index 6ce110aa24..244935e034 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -308,6 +309,15 @@ void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( const wxString& aSearch, bool a const LIB_TREE_NODE* firstMatch = ShowResults(); +#ifdef __WXGTK__ + // Ensure the control is repainted with the updated data. Without an explicit + // refresh the Gtk port can display stale rows until the user interacts with + // them, leading to mismatched tree contents. + m_widget->Refresh(); + m_widget->Update(); + wxYield(); +#endif + if( firstMatch ) { wxDataViewItem item = ToItem( firstMatch );