diff --git a/app/lattecorona.cpp b/app/lattecorona.cpp index 40931027f..f774b73bf 100644 --- a/app/lattecorona.cpp +++ b/app/lattecorona.cpp @@ -267,6 +267,8 @@ void Corona::load() addOutput(screen); } + m_inStartup = false; + connect(qGuiApp, &QGuiApplication::screenAdded, this, &Corona::addOutput, Qt::UniqueConnection); connect(qGuiApp, &QGuiApplication::screenRemoved, this, &Corona::screenRemoved, Qt::UniqueConnection); } @@ -1117,6 +1119,10 @@ void Corona::switchToLayout(QString layout) void Corona::showSettingsWindow(int page) { + if (m_inStartup) { + return; + } + Settings::Dialog::ConfigurationPage p = Settings::Dialog::LayoutPage; if (page >= Settings::Dialog::LayoutPage && page <= Settings::Dialog::PreferencesPage) { diff --git a/app/lattecorona.h b/app/lattecorona.h index 12665dfc1..e17aef2ff 100644 --- a/app/lattecorona.h +++ b/app/lattecorona.h @@ -211,6 +211,7 @@ private: bool m_activitiesStarting{true}; bool m_defaultLayoutOnStartup{false}; //! this is used to enforce loading the default layout on startup + bool m_inStartup{true}; //! this is used in order to identify when application is still in startup phase bool m_inQuit{false}; //! this is used in order to identify when application is in quit phase bool m_quitTimedEnded{false}; //! this is used on destructor in order to delay it and slide-out the views diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index 3773e4b47..0f5b41d2f 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -300,9 +300,14 @@ CentralLayout *Synchronizer::centralLayout(QString layoutname) const QList Synchronizer::currentLayouts() const { QList layouts; + layouts.clear(); + + if (m_centralLayouts.isEmpty()) { + return layouts; + } if (m_manager->memoryUsage() == MemoryUsage::SingleLayout) { - layouts << m_centralLayouts.at(0); + layouts << m_centralLayouts[0]; } else { for (auto layout : m_centralLayouts) { if (layout->isOnAllActivities() || layout->appliedActivities().contains(m_manager->corona()->activitiesConsumer()->currentActivity())) {