From 22f66fdf2f8b62b7fff89196c9919e48790a1dac Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 1 Mar 2024 15:19:13 -0800 Subject: [PATCH] Don't wait for unused events We only need the UI update and mouse/keyboard while updating our DRC window. Waiting for other events gets into a race condition with the schematic editor that can cause a hang Fixes https://gitlab.com/kicad/code/kicad/-/issues/17003 (cherry picked from commit 14667e20336aa98f7576ca6a9f896a97ec2ab60a) --- pcbnew/dialogs/dialog_drc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 60caff82f5..01ca4db712 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -209,7 +210,7 @@ bool DIALOG_DRC::updateUI() double cur = alg::clamp( 0.0, (double) m_progress.load() / m_maxProgress, 1.0 ); m_gauge->SetValue( KiROUND( cur * 1000.0 ) ); - wxSafeYield( this ); + Pgm().App().SafeYieldFor( this, wxEVT_CATEGORY_NATIVE_EVENTS ); return !m_cancelled; }