From 1094cc53319edf0fc21a1da680c6ea1637cc24b8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 24 Jun 2023 18:09:43 +0200 Subject: [PATCH] Fix issues related to the splash screen when no config file found: - do not show it before the application is actually started. - hide the splash screen before displaying dialogs. Fixes #15047 https://gitlab.com/kicad/code/kicad/-/issues/15047 --- common/pgm_base.cpp | 7 ++++--- eeschema/eeschema.cpp | 3 +++ pcbnew/pcbnew.cpp | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 5264b75495..705ea9c0fa 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -506,9 +506,6 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest ) SetLanguagePath(); SetDefaultLanguage( tmp ); - if( !aHeadless ) - ShowSplash(); - m_settings_manager = std::make_unique( aHeadless ); // Our unit test mocks break if we continue @@ -566,6 +563,10 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest ) if( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval != 0 ) wxUpdateUIEvent::SetUpdateInterval( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval ); + // Now the application can safely start, show the splash screen + if( !aHeadless ) + ShowSplash(); + return true; } diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 40654872a0..69ad0a2946 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -370,6 +370,9 @@ bool IFACE::loadGlobalLibTable() { if( !( m_start_flags & KFCTL_CLI ) ) { + // Ensure the splash screen does not hide the dialog: + Pgm().HideSplash(); + DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG symDialog( nullptr ); if( symDialog.ShowModal() != wxID_OK ) diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index a44776f176..c6cd7f9c18 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -385,6 +385,9 @@ bool IFACE::loadGlobalLibTable() { if( !( m_start_flags & KFCTL_CLI ) ) { + // Ensure the splash screen does not hide the dialog: + Pgm().HideSplash(); + DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr ); if( fpDialog.ShowModal() != wxID_OK )