Commit 60095bba authored by Michail Vourlakos's avatar Michail Vourlakos
Browse files

fix #96,FEATURE:AllScreens and AllSecondaryScreens

--This is a HUGE FEATURE and so important for multi-screens
users. It is introduced as one single commit because it
reimplements plenty of infrastructure changes and it will
be easier to identify newly introduced bugs.
--Users can now choose for their docks and panels to belong
at various screen groups. The first two screen groups introduced
are AllScreens and AllSecondayScreens. In the future it might
be possible to provide CustomScreensGroup that the user will
be able to define specific screens in which a dock or panel
should be always present.
--Current solution specifies an Original dock or panel and clones/copies
itself automatically to other screens. So docks and panels in other screens
are just real docks and panels that reference themselves to original
docks and panels.
--Clones are destroyed during layout startup and are automaticaly
recreated. It is suggested to export your layouts through the
official Layouts Editor in order to share them because in that case
clones are not included in the new generated layout file. If in any
case you do not this and you share your layout with any previous
versions then your clones will just appear as separate docks and
panels that belong to specific screens.
--Automatic syncing was introduced in order to keep up-to-date
the configuration of Original docks and panels with their referenced
Clones.
--Automatic syncing currently works for all docks and panels settings,
for all normal applets configurations and for all subcontaiments
configuration such as systrays.
--Automatic syncing does not work for applets inside subcontainments
such as Group Plasmoid. In such case it is suggested to configure
your applets inside your Group Plasmoid in the original dock or panel
and afterwards to trigger a recreation for the relevant clones
--Manual recreation of clones is easily possible by just choosing
the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing
afterwards the AllScreensGroup or AllSecondaryScreensGroup
parent 8a0f1832
......@@ -103,6 +103,12 @@ void Screen::init(const QString &screenId, const QString &serialized)
}
}
bool Screen::isScreensGroup() const
{
int sid = id.toInt();
return ((sid == ONALLSCREENSID) || (sid == ONALLSECONDARYSCREENSID));
}
QString Screen::serialize() const
{
QStringList result;
......
......@@ -23,7 +23,11 @@ class Screen : public Generic
public:
static constexpr const char* SERIALIZESPLITTER = ":::";
static const int ONPRIMARYID = 0;
static const int ONALLSCREENSID = -100;
static const int ONALLSECONDARYSCREENSID = -101;
static constexpr const char* ONPRIMARYNAME = "{primary-screen}";
static constexpr const char* ONALLSCREENSNAME = "{all-screens}";
static constexpr const char* ONALLSECONDARYSCREENSNAME = "{all-secondary-screens}";
Screen();
Screen(Screen &&o);
......@@ -43,6 +47,8 @@ public:
bool operator==(const Screen &rhs) const;
bool operator!=(const Screen &rhs) const;
bool isScreensGroup() const;
void init(const QString &screenId, const QString &serialized);
QString serialize() const;
......
......@@ -8,6 +8,8 @@
namespace Latte {
namespace Data {
const int View::ISCLONEDNULL = -1;
View::View()
: Generic()
{
......@@ -19,8 +21,10 @@ View::View(View &&o)
isMoveOrigin(o.isMoveOrigin),
isMoveDestination(o.isMoveDestination),
onPrimary(o.onPrimary),
isClonedFrom(o.isClonedFrom),
screen(o.screen),
screenEdgeMargin(o.screenEdgeMargin),
screensGroup(o.screensGroup),
maxLength(o.maxLength),
edge(o.edge),
alignment(o.alignment),
......@@ -40,8 +44,10 @@ View::View(const View &o)
isMoveOrigin(o.isMoveOrigin),
isMoveDestination(o.isMoveDestination),
onPrimary(o.onPrimary),
isClonedFrom(o.isClonedFrom),
screen(o.screen),
screenEdgeMargin(o.screenEdgeMargin),
screensGroup(o.screensGroup),
maxLength(o.maxLength),
edge(o.edge),
alignment(o.alignment),
......@@ -68,8 +74,10 @@ View &View::operator=(const View &rhs)
isMoveOrigin = rhs.isMoveOrigin;
isMoveDestination = rhs.isMoveDestination;
onPrimary = rhs.onPrimary;
isClonedFrom = rhs.isClonedFrom;
screen = rhs.screen;
screenEdgeMargin = rhs.screenEdgeMargin,
screenEdgeMargin = rhs.screenEdgeMargin;
screensGroup = rhs.screensGroup;
maxLength = rhs.maxLength;
edge = rhs.edge;
alignment = rhs.alignment;
......@@ -93,8 +101,10 @@ View &View::operator=(View &&rhs)
isMoveOrigin = rhs.isMoveOrigin;
isMoveDestination = rhs.isMoveDestination;
onPrimary = rhs.onPrimary;
isClonedFrom = rhs.isClonedFrom;
screen = rhs.screen;
screenEdgeMargin = rhs.screenEdgeMargin,
screenEdgeMargin = rhs.screenEdgeMargin;
screensGroup = rhs.screensGroup;
maxLength = rhs.maxLength;
edge = rhs.edge;
alignment = rhs.alignment;
......@@ -118,8 +128,10 @@ bool View::operator==(const View &rhs) const
//&& (isMoveOrigin == rhs.isMoveOrigin) /*Disabled because this is not needed in order to track view changes for saving*/
//&& (isMoveDestination == rhs.isMoveDestination) /*Disabled because this is not needed in order to track view changes for saving*/
&& (onPrimary == rhs.onPrimary)
&& (isClonedFrom == rhs.isClonedFrom)
&& (screen == rhs.screen)
&& (screenEdgeMargin == rhs.screenEdgeMargin)
&& (screensGroup == rhs.screensGroup)
&& (maxLength == rhs.maxLength)
&& (edge == rhs.edge)
&& (alignment == rhs.alignment)
......@@ -168,6 +180,21 @@ View::operator QString() const
}
result += " : ";
if (isCloned()) {
result += ("Cloned from:"+ isClonedFrom);
} else {
result += "Original";
}
result += " : ";
if (screensGroup == Latte::Types::SingleScreenGroup) {
result += onPrimary ? "Primary" : "Explicit";
} else if (screensGroup == Latte::Types::AllScreensGroup) {
result += "All Screens";
} else if (screensGroup == Latte::Types::AllSecondaryScreensGroup) {
result += "All Secondary Screens";
}
result += onPrimary ? "Primary" : "Explicit";
result += " : ";
result += QString::number(screen);
......@@ -212,6 +239,16 @@ bool View::isCreated() const
return m_state == IsCreated;
}
bool View::isOriginal() const
{
return !isCloned();
}
bool View::isCloned() const
{
return isClonedFrom != ISCLONEDNULL;
}
bool View::isValid() const
{
return m_state != IsInvalid;
......
......@@ -32,6 +32,8 @@ public:
OriginFromLayout /*used from duplicate, copy, move view functions*/
};
static const int ISCLONEDNULL;
View();
View(View &&o);
View(const View &o);
......@@ -40,11 +42,13 @@ public:
//! View data
bool isActive{false};
bool onPrimary{true};
int isClonedFrom{ISCLONEDNULL};
int screen{Latte::ScreenPool::FIRSTSCREENID};
int screenEdgeMargin{0};
float maxLength{1.0};
Plasma::Types::Location edge{Plasma::Types::BottomEdge};
Latte::Types::Alignment alignment{Latte::Types::Center};
Latte::Types::ScreensGroup screensGroup{Latte::Types::SingleScreenGroup};
GenericTable<Data::Generic> subcontainments;
int errors{0};
......@@ -56,6 +60,8 @@ public:
bool isValid() const;
bool isCreated() const;
bool isOriginal() const;
bool isCloned() const;
bool hasViewTemplateOrigin() const;
bool hasLayoutOrigin() const;
bool hasSubContainment(const QString &subId) const;
......
......@@ -90,6 +90,19 @@ ViewsTable ViewsTable::subtracted(const ViewsTable &rhs) const
return subtract;
}
ViewsTable ViewsTable::onlyOriginals() const
{
ViewsTable originals;
for(int i=0; i<m_list.count(); ++i) {
if (m_list[i].isOriginal()) {
originals << m_list[i];
}
}
return originals;
}
void ViewsTable::appendTemporaryView(const Data::View &view)
{
int maxTempId = 0;
......
......@@ -38,6 +38,7 @@ public:
bool operator==(const ViewsTable &rhs) const;
bool operator!=(const ViewsTable &rhs) const;
ViewsTable subtracted(const ViewsTable &rhs) const;
ViewsTable onlyOriginals() const;
};
}
......
......@@ -32,6 +32,7 @@
#include "plasma/extended/theme.h"
#include "settings/universalsettings.h"
#include "templates/templatesmanager.h"
#include "view/originalview.h"
#include "view/view.h"
#include "view/settings/viewsettingsfactory.h"
#include "view/windowstracker/windowstracker.h"
......@@ -1192,9 +1193,25 @@ QStringList Corona::contextMenuData(const uint &containmentId)
}
data << layoutsmenu.join(";;");
data << QString::number((int)viewType); //Selected View type
data << (view ? view->layout()->name() : QString()); //Selected View layout*/
QStringList viewtype;
viewtype << QString::number((int)viewType); //Selected View type
if (view && view->isOriginal()) { /*View*/
auto originalview = qobject_cast<Latte::OriginalView *>(view);
viewtype << "0"; //original view
viewtype << QString::number(originalview->clonesCount());
} else if (view && view->isCloned()) {
viewtype << "1"; //cloned view
viewtype << "0"; //has no clones
} else {
viewtype << "0"; //original view
viewtype << "0"; //has no clones
}
data << viewtype.join(";;");
return data;
}
......@@ -1247,7 +1264,14 @@ void Corona::moveViewToLayout(const uint &containmentId, const QString &layoutNa
{
auto view = m_layoutsManager->synchronizer()->viewForContainment((int)containmentId);
if (view && !layoutName.isEmpty() && view->layout()->name() != layoutName) {
view->positioner()->setNextLocation(layoutName, "", Plasma::Types::Floating, Latte::Types::NoneAlignment);
Latte::Types::ScreensGroup screensgroup{Latte::Types::SingleScreenGroup};
if (view->isOriginal()) {
auto originalview = qobject_cast<Latte::OriginalView *>(view);
screensgroup = originalview->screensGroup();
}
view->positioner()->setNextLocation(layoutName, screensgroup, "", Plasma::Types::Floating, Latte::Types::NoneAlignment);
}
}
......
......@@ -46,9 +46,9 @@ void CentralLayout::init()
connect(this, &CentralLayout::showInMenuChanged, this, &CentralLayout::saveConfig);
}
void CentralLayout::initToCorona(Latte::Corona *corona)
bool CentralLayout::initCorona()
{
if (GenericLayout::initToCorona(corona)) {
if (GenericLayout::initCorona()) {
onSchemeFileChanged();
connect(this, &CentralLayout::disableBordersForMaximizedWindowsChanged,
......@@ -56,7 +56,10 @@ void CentralLayout::initToCorona(Latte::Corona *corona)
connect(this, &Layout::AbstractLayout::schemeFileChanged, this, &CentralLayout::onSchemeFileChanged);
connect(m_corona->wm()->schemesTracker(), &WindowSystem::Tracker::Schemes::defaultSchemeChanged, this, &CentralLayout::onSchemeFileChanged);
return true;
}
return false;
}
bool CentralLayout::disableBordersForMaximizedWindows() const
......
......@@ -41,7 +41,7 @@ public:
CentralLayout(QObject *parent, QString layoutFile, QString layoutName = QString());
~CentralLayout() override;
void initToCorona(Latte::Corona *corona);
bool initCorona() override;
bool disableBordersForMaximizedWindows() const;
void setDisableBordersForMaximizedWindows(bool disable);
......
This diff is collapsed.
......@@ -55,12 +55,15 @@ public:
virtual const QStringList appliedActivities() = 0; // to move at an interface
virtual bool initCorona();
void importToCorona();
bool initToCorona(Latte::Corona *corona);
bool initContainments();
void setCorona(Latte::Corona *corona);
bool isActive() const; //! is loaded and running
virtual bool isCurrent();
bool isWritable() const;
bool hasCorona() const;
virtual int viewsCount(int screen) const;
virtual int viewsCount(QScreen *screen) const;
......@@ -92,8 +95,9 @@ public:
QList<Latte::View *> sortedLatteViews();
virtual QList<Latte::View *> viewsWithPlasmaShortcuts();
virtual QList<Latte::View *> latteViews();
ViewsMap validViewsMap(ViewsMap *occupiedMap = nullptr);
virtual void syncLatteViewsToScreens(Layout::ViewsMap *occupiedMap = nullptr);
virtual QList<Latte::View *> onlyOriginalViews();
ViewsMap validViewsMap();
virtual void syncLatteViewsToScreens();
void syncToLayoutFile(bool removeLayoutId = false);
......@@ -106,10 +110,10 @@ public:
virtual void setLastConfigViewFor(Latte::View *view);
virtual Latte::View *lastConfigViewFor();
//! this function needs the layout to have first set the corona through initToCorona() function
virtual void addView(Plasma::Containment *containment, bool forceOnPrimary = false, int explicitScreen = -1, Layout::ViewsMap *occupied = nullptr);
//! this function needs the layout to have first set the corona through setCorona() function
virtual void addView(Plasma::Containment *containment);
void recreateView(Plasma::Containment *containment, bool delayed = true);
bool latteViewExists(Plasma::Containment *containment);
bool hasLatteView(Plasma::Containment *containment);
bool newView(const QString &templateName);
Data::View newView(const Latte::Data::View &nextViewData);
......@@ -190,6 +194,7 @@ private:
bool viewDataAtLowerStatePriority(const Latte::Data::View &test, const Latte::Data::View &base) const;
bool mapContainsId(const ViewsMap *map, uint viewId) const;
QString mapScreenName(const ViewsMap *map, uint viewId) const;
QList<int> subContainmentsOf(Plasma::Containment *containment) const;
......@@ -199,7 +204,7 @@ private:
private:
bool m_blockAutomaticLatteViewCreation{false};
bool m_hasInitializedContainments{false};
QPointer<Latte::View> m_lastConfigViewFor;
QStringList m_unloadedContainmentsIds;
......
......@@ -16,6 +16,7 @@
#include "../data/generictable.h"
#include "../layout/abstractlayout.h"
#include "../layout/centrallayout.h"
#include "../layouts/storage.h"
#include "../settings/universalsettings.h"
#include "../templates/templatesmanager.h"
#include "../tools/commontools.h"
......@@ -332,6 +333,8 @@ void Manager::setOnActivities(QString layoutName, QStringList activities)
void Manager::cleanupOnStartup(QString path)
{
Layouts::Storage::self()->removeAllClonedViews(path);
KSharedConfigPtr filePtr = KSharedConfig::openConfig(path);
KConfigGroup actionGroups = KConfigGroup(filePtr, "ActionPlugins");
......
......@@ -12,6 +12,7 @@
#include "../lattecorona.h"
#include "../screenpool.h"
#include "../data/errordata.h"
#include "../data/viewdata.h"
#include "../layout/abstractlayout.h"
#include "../view/view.h"
......@@ -99,13 +100,13 @@ bool Storage::isLatteContainment(const KConfigGroup &group) const
return pluginId == QLatin1String("org.kde.latte.containment");
}
bool Storage::isSubContainment(const Layout::GenericLayout *layout, const Plasma::Applet *applet) const
bool Storage::isSubContainment(const Plasma::Corona *corona, const Plasma::Applet *applet) const
{
if (!layout || !applet) {
if (!corona || !applet) {
return false;
}
for (const auto containment : *layout->containments()) {
for (const auto containment : corona->containments()) {
Plasma::Applet *parentApplet = qobject_cast<Plasma::Applet *>(containment->parent());
if (parentApplet && parentApplet == applet) {
return true;
......@@ -178,14 +179,14 @@ int Storage::subIdentityIndex(const KConfigGroup &appletGroup) const
return IDNULL;
}
Plasma::Containment *Storage::subContainmentOf(const Layout::GenericLayout *layout, const Plasma::Applet *applet)
Plasma::Containment *Storage::subContainmentOf(const Plasma::Corona *corona, const Plasma::Applet *applet)
{
if (!layout || !applet) {
if (!corona || !applet) {
return nullptr;
}
if (isSubContainment(layout, applet)) {
for (const auto containment : *layout->containments()) {
if (isSubContainment(corona, applet)) {
for (const auto containment : corona->containments()) {
Plasma::Applet *parentApplet = qobject_cast<Plasma::Applet *>(containment->parent());
if (parentApplet && parentApplet == applet) {
return containment;
......@@ -224,6 +225,8 @@ void Storage::importToCorona(const Layout::GenericLayout *layout)
//! Setting mutable for create a containment
layout->corona()->setImmutability(Plasma::Types::Mutable);
removeAllClonedViews(layout->file());
QString temp1FilePath = m_storageTmpDir.path() + "/" + layout->name() + ".multiple.views";
//! we need to copy first the layout file because the kde cache
//! may not have yet been updated (KSharedConfigPtr)
......@@ -240,8 +243,9 @@ void Storage::importToCorona(const Layout::GenericLayout *layout)
tempLayoutFile.remove();
}
if (copyFile.exists())
if (copyFile.exists()) {
copyFile.remove();
}
layoutOriginalFile.copy(tempLayoutFilePath);
......@@ -329,7 +333,7 @@ QString Storage::newUniqueIdsFile(QString originFile, const Layout::GenericLayou
QString currentdestinationname = destinationLayout->name();
QString currentdestinationfile = "";
if (!destinationLayout->isActive()) {
if (!destinationLayout->hasCorona()) {
currentdestinationfile = destinationLayout->file();
}
......@@ -344,7 +348,7 @@ QString Storage::newUniqueIdsFile(QString originFile, const Layout::GenericLayou
//! BEGIN updating the ids in the temp file
QStringList allIds;
if (destinationLayout->isActive()) {
if (destinationLayout->hasCorona()) {
allIds << destinationLayout->corona()->containmentsIds();
allIds << destinationLayout->corona()->appletsIds();
} else {
......@@ -475,7 +479,7 @@ QString Storage::newUniqueIdsFile(QString originFile, const Layout::GenericLayou
}
}
if (destinationLayout->isActive() && destinationLayout->corona()->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts) {
if (destinationLayout->hasCorona() && destinationLayout->corona()->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts) {
//! will be added in main corona multiple layouts file
investigate_conts.group(cId).writeEntry("layoutId", destinationLayout->name());
} else {
......@@ -560,6 +564,7 @@ void Storage::syncToLayoutFile(const Layout::GenericLayout *layout, bool removeL
}
filePtr->reparseConfiguration();
removeAllClonedViews(layout->file());
}
QList<Plasma::Containment *> Storage::importLayoutFile(const Layout::GenericLayout *layout, QString file)
......@@ -567,13 +572,10 @@ QList<Plasma::Containment *> Storage::importLayoutFile(const Layout::GenericLayo
KSharedConfigPtr filePtr = KSharedConfig::openConfig(file);
auto newContainments = layout->corona()->importLayout(KConfigGroup(filePtr, ""));
qDebug() << " imported containments ::: " << newContainments.length();
QList<Plasma::Containment *> importedViews;
for (const auto containment : newContainments) {
if (isLatteContainment(containment)) {
qDebug() << "new latte containment id: " << containment->id();
importedViews << containment;
}
}
......@@ -609,7 +611,7 @@ Data::View Storage::newView(const Layout::GenericLayout *destinationLayout, cons
qDebug() << "new view for layout";
if (destinationLayout->isActive()) {
if (destinationLayout->hasCorona()) {
//! Setting mutable for create a containment
destinationLayout->corona()->setImmutability(Plasma::Types::Mutable);
}
......@@ -650,7 +652,7 @@ Data::View Storage::newView(const Layout::GenericLayout *destinationLayout, cons
return Data::View();
}
if (destinationLayout->isActive()) {
if (destinationLayout->hasCorona()) {
//! import views for active layout
QList<Plasma::Containment *> importedViews = importLayoutFile(destinationLayout, temp2File);
......@@ -732,6 +734,7 @@ bool Storage::exportTemplate(const QString &originFile, const QString &destinati
KConfigGroup layoutSettingsGrp(destFilePtr, "LayoutSettings");
clearExportedLayoutSettings(layoutSettingsGrp);
destFilePtr->reparseConfiguration();
removeAllClonedViews(destinationFile);
return true;
}
......@@ -828,6 +831,7 @@ bool Storage::exportTemplate(const Layout::GenericLayout *layout, Plasma::Contai
KConfigGroup layoutSettingsGrp(destFilePtr, "LayoutSettings");
clearExportedLayoutSettings(layoutSettingsGrp);
destFilePtr->reparseConfiguration();
removeAllClonedViews(destinationFile);
return true;
}
......@@ -1271,7 +1275,7 @@ Data::AppletsTable Storage::plugins(const Layout::GenericLayout *layout, const i
}
for (auto applet : containment->applets()) {
if (isSubContainment(layout, applet)) {
if (isSubContainment(layout->corona(), applet)) {
validcontainmentids << subContainmentId(applet->config());
}
}
......@@ -1426,6 +1430,51 @@ bool Storage::hasContainment(const Layout::GenericLayout *layout, const int &id)
return false;
}
bool Storage::isClonedView(const Plasma::Containment *containment) const
{
if (!containment) {
return false;
}
return isClonedView(containment->config());
}
bool Storage::isClonedView(const KConfigGroup &containmentGroup) const
{
if (!isLatteContainment(containmentGroup)) {
return false;
}
int isClonedFrom = containmentGroup.readEntry("isClonedFrom", Data::View::ISCLONEDNULL);
return (isClonedFrom != IDNULL);
}
void Storage::removeAllClonedViews(const QString &filepath)
{
KSharedConfigPtr lFile = KSharedConfig::openConfig(filepath);
KConfigGroup containmentGroups = KConfigGroup(lFile, "Containments");
QList<Data::View> clones;
for (const auto &contId : containmentGroups.groupList()) {
if (isClonedView(containmentGroups.group(contId))) {
clones << view(containmentGroups.group(contId));
}
}
if (clones.size() <= 0) {
return;
}
if (clones.count()>0) {
qDebug() << "org.kde.layout :: Removing clones from file: " << filepath;
}
for (const auto &clonedata : clones) {
qDebug() << "org.kde.layout :: Removing clone:" << clonedata.id << " and its subcontainments:" << clonedata.subcontainments;
removeView(filepath, clonedata);
}
}
Data::GenericTable<Data::Generic> Storage::subcontainments(const Layout::GenericLayout *layout, const Plasma::Containment *lattecontainment) const
{
......@@ -1505,8 +1554,10 @@ Data::View Storage::view(const KConfigGroup &containmentGroup)
vdata.id = containmentGroup.name();
vdata.name = containmentGroup.readEntry("name", QString());
vdata.isActive = false;
vdata.screensGroup = static_cast<Latte::Types::ScreensGroup>(containmentGroup.readEntry("screensGroup", (int)Latte::Types::SingleScreenGroup));
vdata.onPrimary = containmentGroup.readEntry("onPrimary", true);
vdata.screen = containmentGroup.readEntry("lastScreen", IDNULL);
vdata.isClonedFrom = containmentGroup.readEntry("isClonedFrom", Data::View::ISCLONEDNULL);
vdata.screenEdgeMargin = containmentGroup.group("General").readEntry("screenEdgeMargin", (int)-1);
int location = containmentGroup.readEntry("location", (int)Plasma::Types::BottomEdge);
......@@ -1530,7 +1581,9 @@ void Storage::updateView(KConfigGroup viewGroup, const Data::View &viewData)
}
viewGroup.writeEntry("name", viewData.name);
viewGroup.writeEntry("screensGroup", (int)viewData.screensGroup);
viewGroup.writeEntry("onPrimary", viewData.onPrimary);
viewGroup.writeEntry("isClonedFrom", viewData.isClonedFrom);
viewGroup.writeEntry("lastScreen", viewData.screen);
viewGroup.group("General").writeEntry("screenEdgeMargin", viewData.screenEdgeMargin);
viewGroup.writeEntry("location", (int)viewData.edge);
......@@ -1677,6 +1730,38 @@ QString Storage::storedView(const Layout::GenericLayout *layout, const int &cont
return nextTmpStoredViewAbsolutePath;
}
int Storage::expectedViewScreenId(const Latte::Corona *corona, const KConfigGroup &containmentGroup) const
{
return expectedViewScreenId(corona, self()->view(containmentGroup));
}
int Storage::expectedViewScreenId(const Layout::GenericLayout *layout, const Plasma::Containment *lattecontainment) const
{
if (!layout || !layout->corona()) {
return Latte::ScreenPool::NOSCREENID;
}
return expectedViewScreenId(layout->corona(), self()->view(layout, lattecontainment));
}
int Storage::expectedViewScreenId(const Latte::Corona *corona, const Data::View &view) const
{
if (!corona || !view.isValid()) {
return Latte::ScreenPool::NOSCREENID;
}
if (view.screensGroup == Latte::Types::SingleScreenGroup || view.isCloned()) {
return view.onPrimary ? corona->screenPool()->primaryScreenId() : view.screen;
} else if (view.screensGroup == Latte::Types::AllScreensGroup) {
return corona->screenPool()->primaryScreenId();
} else if (view.screensGroup == Latte::Types::AllSecondaryScreensGroup) {