fixes for assigned layouts handling

pull/11/head
Michail Vourlakos 5 years ago
parent ba94546cb4
commit 22a9416583

@ -98,17 +98,7 @@ bool Synchronizer::layoutExists(QString layoutName) const
bool Synchronizer::layoutIsAssigned(QString layoutName)
{
QHashIterator<const QString, QString> i(m_assignedLayouts);
while (i.hasNext()) {
i.next();
if (i.value() == layoutName) {
return true;
}
}
return false;
return m_assignedLayouts.values().contains(layoutName);
}
bool Synchronizer::mapHasRecord(const QString &record, SharesMap &map)
@ -830,7 +820,7 @@ void Synchronizer::syncMultipleLayoutsToActivities(QString layoutForFreeActiviti
}
for (const auto &activity : runningActivities()) {
if (!m_assignedLayouts[activity].isEmpty()) {
if (m_assignedLayouts.contains(activity)) {
if (!layoutsToLoad.contains(m_assignedLayouts[activity])) {
layoutsToLoad.append(m_assignedLayouts[activity]);
}

@ -921,26 +921,38 @@ bool View::isOnActivity(const QString &activity) const
QStringList View::activities() const
{
return m_activities;
QStringList running;
QStringList runningAll = m_corona->activitiesConsumer()->runningActivities();
for(int i=0; i<m_activities.count(); ++i) {
if (runningAll.contains(m_activities[i])) {
running << m_activities[i];
}
}
return running;
}
void View::applyActivitiesToWindows()
{
if (m_visibility && m_layout) {
m_windowsTracker->setWindowOnActivities(*this, m_activities);
QStringList runningActivities = activities();
m_windowsTracker->setWindowOnActivities(*this, runningActivities);
if (m_configView) {
m_windowsTracker->setWindowOnActivities(*m_configView, m_activities);
m_windowsTracker->setWindowOnActivities(*m_configView, runningActivities);
auto configView = qobject_cast<ViewPart::PrimaryConfigView *>(m_configView);
if (configView && configView->secondaryWindow()) {
m_windowsTracker->setWindowOnActivities(*configView->secondaryWindow(), m_activities);
m_windowsTracker->setWindowOnActivities(*configView->secondaryWindow(), runningActivities);
}
}
if (m_visibility->supportsKWinEdges()) {
m_visibility->applyActivitiesToHiddenWindows(m_activities);
m_visibility->applyActivitiesToHiddenWindows(runningActivities);
}
}
}

Loading…
Cancel
Save