diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index bd4e83056e..875905c56c 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -50,6 +50,8 @@ #include // LEGACY_BOARD_FILE_VERSION #include +#include +#include //#define USE_INSTRUMENTATION 1 @@ -446,6 +448,8 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in return false; } + wxWindowUpdateLocker no_update( m_Layers ); // Avoid flicker when rebuilding m_Layers + Clear_Pcb( false ); // pass false since we prompted above for a modified board IO_MGR::PCB_FILE_T pluginType = plugin_type( fullFileName, aCtl ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 919d198876..b79a0e2e4f 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -85,6 +85,7 @@ #include #include #include +#include #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) #include @@ -255,8 +256,9 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools ); m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools ); - ReFillLayerWidget(); // this is near end because contents establish size m_Layers->ReFillRender(); // Update colors in Render after the config is read + ReFillLayerWidget(); // this is near end and after ReFillRender() + // because contents establish size syncLayerWidgetLayer(); m_auimgr.Update(); @@ -432,6 +434,7 @@ void PCB_EDIT_FRAME::setupTools() void PCB_EDIT_FRAME::ReFillLayerWidget() { + wxWindowUpdateLocker no_update( m_Layers ); m_Layers->ReFill(); wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );