diff --git a/shell/autotests/screenpooltest.cpp b/shell/autotests/screenpooltest.cpp --- a/shell/autotests/screenpooltest.cpp +++ b/shell/autotests/screenpooltest.cpp @@ -51,6 +51,7 @@ cg.deleteGroup(); cg.sync(); m_screenPool = new ScreenPool(KSharedConfig::openConfig(), this); + m_screenPool->load(); } void ScreenPoolTest::cleanupTestCase() diff --git a/shell/screenpool.h b/shell/screenpool.h --- a/shell/screenpool.h +++ b/shell/screenpool.h @@ -33,6 +33,7 @@ public: ScreenPool(KSharedConfig::Ptr config, QObject *parent = nullptr); + void load(); ~ScreenPool() override; QString primaryConnector() const; diff --git a/shell/screenpool.cpp b/shell/screenpool.cpp --- a/shell/screenpool.cpp +++ b/shell/screenpool.cpp @@ -30,6 +30,14 @@ connect(&m_configSaveTimer, &QTimer::timeout, this, [this](){ m_configGroup.sync(); }); +} + +void ScreenPool::load() +{ + m_primaryConnector = QString(); + m_connectorForId.clear(); + m_idForConnector.clear(); + QScreen *primary = qGuiApp->primaryScreen(); if (primary) { m_primaryConnector = primary->name(); diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -627,6 +627,8 @@ disconnect(m_activityController, &KActivities::Controller::serviceStatusChanged, this, &ShellCorona::load); + m_screenPool->load(); + //TODO: a kconf_update script is needed QString configFileName(QStringLiteral("plasma-") + m_shell + QStringLiteral("-appletsrc")); @@ -1184,7 +1186,7 @@ //in the case of a corrupt config file //with multiple containments with same lastScreen //it can happen two insertContainment happen for - //the same screen, leading to the old containment + //the same screen, leading to the old containment //to be destroyed if (!cont->destroyed() && cont->screen() == screenNum && cont->activity() == activity) { return cont;