Browse Source

Prevent GTK from providing stale position

When the library name and symbol/footprint name both match the filter,
we try to display both but ensure visible can move things to the wrong
place.  We need to ensure the filtered list is up to date prior to
moving by ensureVisible

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18000
master
Seth Hillbrand 1 month ago
parent
commit
dc7e0665c3
  1. 10
      common/lib_tree_model_adapter.cpp

10
common/lib_tree_model_adapter.cpp

@ -32,6 +32,7 @@
#include <wx/wupdlock.h>
#include <wx/settings.h>
#include <wx/dc.h>
#include <wx/log.h>
#include <string_utils.h>
@ -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 );

Loading…
Cancel
Save