From 783480d2a6a45df7855d5250f8427a3499345ef9 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 8 Mar 2026 23:22:32 +0000 Subject: [PATCH] Always force toolbars to be visible when restoring settings There seem to be some cases where the AUI perspectives are getting saved with false visibility. This means they aren't getting shown when settings are restored. We don't support hiding toolbars, so just always force them to be shown because otherwise there is no other way to get them back. --- common/eda_base_frame.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index f0ed875798..ff2ee5d327 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -1215,19 +1215,20 @@ void EDA_BASE_FRAME::RestoreAuiLayout() * wx 3.2 or the first settings upgrade when wx 3.3 is used in KiCad (e.g., 9.0->10.0 for Windows and macOS). */ if( !restored && !m_perspective.IsEmpty() ) - { m_auimgr.LoadPerspective( m_perspective ); - // Workaround for wx 3.2: LoadPerspective() hides all panes first, then shows only - // those in the saved string. If toolbar names changed or new toolbars were added, - // they'd stay hidden. Ensure all toolbars are visible after restore. - wxAuiPaneInfoArray& panes = m_auimgr.GetAllPanes(); + // Workaround for two bugs: + // 1) wx 3.2: LoadPerspective() hides all panes first, then shows only + // those in the saved string. If toolbar names changed or new toolbars were added, + // they'd stay hidden. Ensure all toolbars are visible after restore. + // 2) We still saw this even after this fix, so just make the toolbars shown unconditionally + // since we don't actually allow hiding them. The root cause of this part is not known. + wxAuiPaneInfoArray& panes = m_auimgr.GetAllPanes(); - for( size_t i = 0; i < panes.GetCount(); ++i ) - { - if( panes.Item( i ).IsToolbar() ) - panes.Item( i ).Show( true ); - } + for( size_t i = 0; i < panes.GetCount(); ++i ) + { + if( panes.Item( i ).IsToolbar() ) + panes.Item( i ).Show( true ); } }