Fix empty symbol chooser previews on first load

Add an aAllowSkip parameter to DoRePaint that gates both skip
checks.  onPaint and ForceRefresh pass false so they always
execute the full GL/Cairo cycle.  The rate-limited Refresh path
continues to pass true (the default), preserving the GPU
utilization improvement from b728c08b7a.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23325
This commit is contained in:
Seth Hillbrand
2026-03-04 08:11:02 -08:00
parent 113746dc81
commit 02f31c8de1
2 changed files with 8 additions and 6 deletions
+7 -5
View File
@@ -193,11 +193,11 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
{
Refresh( false );
DoRePaint( false );
}
bool EDA_DRAW_PANEL_GAL::DoRePaint()
bool EDA_DRAW_PANEL_GAL::DoRePaint( bool aAllowSkip )
{
if( !m_refreshMutex.try_lock() )
return false;
@@ -254,7 +254,9 @@ bool EDA_DRAW_PANEL_GAL::DoRePaint()
bool hasPendingItemUpdates = m_view->HasPendingItemUpdates();
// Skip all update work when nothing has changed since the previous frame.
if( !viewDirty && !cursorMoved && !hasPendingItemUpdates )
// Never skip when responding to a native paint event or explicit ForceRefresh
// because the window content may have been invalidated by the OS.
if( aAllowSkip && !viewDirty && !cursorMoved && !hasPendingItemUpdates )
{
m_lastRepaintEnd = wxGetLocalTimeMillis();
return true;
@@ -290,7 +292,7 @@ bool EDA_DRAW_PANEL_GAL::DoRePaint()
// After processing item updates, skip the GL cycle when neither the
// view targets nor the cursor position have changed.
if( !viewDirty && !cursorMoved )
if( aAllowSkip && !viewDirty && !cursorMoved )
{
m_lastRepaintEnd = wxGetLocalTimeMillis();
return true;
@@ -478,7 +480,7 @@ void EDA_DRAW_PANEL_GAL::ForceRefresh()
}
}
DoRePaint();
DoRePaint( false );
}
+1 -1
View File
@@ -233,7 +233,7 @@ public:
*
* @return true if the repaint attempt was successful.
*/
bool DoRePaint();
bool DoRePaint( bool aAllowSkip = true );
/**
* Create an overlay for rendering debug graphics.