1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

multi-screen:improve syncLatteViews() function

--onPrimary flag is considered from layout file directly
only for containments that are not already loaded to
latte views
--location flag is accessed directly from containment object
This commit is contained in:
Michail Vourlakos 2019-03-21 08:20:08 +02:00
parent f95e121687
commit 95d37ff6a7

View File

@ -1511,8 +1511,15 @@ void Layout::syncDockViewsToScreens()
screenId = containment->lastScreen();
}
bool onPrimary = containment->config().readEntry("onPrimary", true);
Plasma::Types::Location location = static_cast<Plasma::Types::Location>((int)containment->config().readEntry("location", (int)Plasma::Types::BottomEdge));
bool onPrimary{true};
if (latteViewExists(containment)) {
onPrimary = m_latteViews[containment]->onPrimary();
} else {
onPrimary = containment->config().readEntry("onPrimary", true);
}
Plasma::Types::Location location = containment->location();
if (onPrimary && !futureDocksLocations[prmScreenName].contains(location)) {
futureDocksLocations[prmScreenName].append(location);
@ -1530,8 +1537,15 @@ void Layout::syncDockViewsToScreens()
screenId = containment->lastScreen();
}
bool onPrimary = containment->config().readEntry("onPrimary", true);
Plasma::Types::Location location = static_cast<Plasma::Types::Location>((int)containment->config().readEntry("location", (int)Plasma::Types::BottomEdge));
bool onPrimary{true};
if (latteViewExists(containment)) {
onPrimary = m_latteViews[containment]->onPrimary();
} else {
onPrimary = containment->config().readEntry("onPrimary", true);
}
Plasma::Types::Location location = containment->location();
if (!onPrimary) {
QString expScreenName = m_corona->screenPool()->connector(screenId);