From be5102a6e02a2f4a76f11b62b8484d8489abe4cc Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 19 Dec 2020 14:47:47 -0500 Subject: [PATCH] Prevent refresh loops on GTK/MSW Fixes https://gitlab.com/kicad/code/kicad/-/issues/6787 (cherry picked from commit 281180512f358e164e45dfb1ae833d342cfc15ce) --- common/draw_panel_gal.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index e0fe05c408..72e4a7ab51 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -295,7 +295,9 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect ) // This ensures that we will render often enough but not too often. if( delta >= MinRefreshPeriod ) { - ForceRefresh(); + if( !m_pendingRefresh ) + ForceRefresh(); + m_refreshTimer.Start( MinRefreshPeriod, true ); } else if( !m_refreshTimer.IsRunning() ) @@ -309,6 +311,7 @@ void EDA_DRAW_PANEL_GAL::ForceRefresh() { //wxPaintEvent redrawEvent; //wxPostEvent( this, redrawEvent ); + m_pendingRefresh = true; DoRePaint(); }