From 63e55e91800e57795592585ad556a1e11733ff98 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 14 Jan 2018 17:38:48 +0100 Subject: [PATCH] Try to fix a regression on OSX Fixes: lp:1740909 https://bugs.launchpad.net/kicad/+bug/1740909 --- pcbnew/drc.cpp | 13 +++++++++++-- pcbnew/zones_by_polygon_fill_functions.cpp | 12 ++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index 5f52e2f921..f4b5591ca7 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -408,8 +408,17 @@ void DRC::RunTests( wxTextCtrl* aMessages ) wxSafeYield(); } - m_pcbEditorFrame->Fill_All_Zones( aMessages ? aMessages->GetParent() : m_pcbEditorFrame, - false ); + // Refill all zones + // On OSX the progress bar managed by Fill_All_Zones() create issues + // when Fill_All_Zones() is called by a QuasiModal dialog + // so it is not shown on OSX, until a better fix is found +#ifdef __WXMAC__ + wxWindow* caller = nullptr; // Do not show progress bar +#else + // caller (a wxTopLevelFrame) is the wxDialog or the Pcb Editor frame that call DRC: + wxWindow* caller = aMessages ? aMessages->GetParent() : m_pcbEditorFrame; +#endif + m_pcbEditorFrame->Fill_All_Zones( caller, true ); // test zone clearances to other zones if( aMessages ) diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index bf4d14f127..9e5ca348f8 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -103,13 +103,17 @@ int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose ) ZONE_FILLER filler( GetBoard() ); - std::unique_ptr progressReporter( + // progressReporter must be created *only* if needed + if( aActiveWindow ) + { + std::unique_ptr progressReporter( new WX_PROGRESS_REPORTER( aActiveWindow, _( "Fill All Zones" ), 3 ) ); - if( aVerbose ) filler.SetProgressReporter( progressReporter.get() ); - - filler.Fill( toFill ); + filler.Fill( toFill ); + } + else // do not use a WX_PROGRESS_REPORTER in ZONE_FILLER instance + filler.Fill( toFill ); return 0; }