diff --git a/app/layout/centrallayout.cpp b/app/layout/centrallayout.cpp index 337eb380b..b90341f47 100644 --- a/app/layout/centrallayout.cpp +++ b/app/layout/centrallayout.cpp @@ -292,6 +292,16 @@ void CentralLayout::addView(Plasma::Containment *containment, bool forceOnPrimar } } +bool CentralLayout::configViewIsShown() const +{ + bool genericShown = GenericLayout::configViewIsShown(); + if (m_sharedLayout) { + return (m_sharedLayout->configViewIsShown() || genericShown); + } + + return genericShown; +} + const QStringList CentralLayout::appliedActivities() { if (!m_corona) { diff --git a/app/layout/centrallayout.h b/app/layout/centrallayout.h index 8dcad6b24..c578481be 100644 --- a/app/layout/centrallayout.h +++ b/app/layout/centrallayout.h @@ -67,8 +67,6 @@ public: QStringList activities() const; void setActivities(QStringList activities); - Latte::View *lastSettingsView(); - SharedLayout *sharedLayout() const; void setSharedLayout(SharedLayout *layout); @@ -76,6 +74,7 @@ public: void addView(Plasma::Containment *containment, bool forceOnPrimary = false, int explicitScreen = -1, Layout::ViewsMap *occupied = nullptr); void syncLatteViewsToScreens(Layout::ViewsMap *occupiedMap = nullptr) override; void unloadContainments() override; + bool configViewIsShown() const override; const QStringList appliedActivities() override; Types::ViewType latteViewType(int containmentId) const override; QList latteViews() override; diff --git a/app/layout/genericlayout.cpp b/app/layout/genericlayout.cpp index ff90ecf50..f3e401e05 100644 --- a/app/layout/genericlayout.cpp +++ b/app/layout/genericlayout.cpp @@ -139,6 +139,17 @@ void GenericLayout::setBlockAutomaticLatteViewCreation(bool block) m_blockAutomaticLatteViewCreation = block; } +bool GenericLayout::configViewIsShown() const +{ + for (const auto view : m_latteViews) { + if (view && view->settingsWindowIsShown()) { + return true; + } + } + + return false; +} + bool GenericLayout::isActive() const { if (!m_corona) { diff --git a/app/layout/genericlayout.h b/app/layout/genericlayout.h index 3ebea935c..1e7570a5b 100644 --- a/app/layout/genericlayout.h +++ b/app/layout/genericlayout.h @@ -76,6 +76,8 @@ public: bool isWritable() const; bool layoutIsBroken() const; + virtual bool configViewIsShown() const; + virtual int viewsCount(int screen) const; virtual int viewsCount(QScreen *screen) const; virtual int viewsCount() const; diff --git a/app/shortcuts/globalshortcuts.cpp b/app/shortcuts/globalshortcuts.cpp index 510d4ce2f..966437448 100644 --- a/app/shortcuts/globalshortcuts.cpp +++ b/app/shortcuts/globalshortcuts.cpp @@ -732,7 +732,7 @@ void GlobalShortcuts::showSettings() } if (openSettings >= 0 && sortedViews.count() > 1) { - openSettings = openSettings + 1; + openSettings = currentLayout->configViewIsShown() ? openSettings + 1 : openSettings; if (openSettings >= sortedViews.size()) { openSettings = 0;