Commit 9a10af95 authored by Kevin Ottens's avatar Kevin Ottens Committed by Kevin Ottens
Browse files

Wire the activity protocol parts to AbstractClient

parent d612d76e
......@@ -1682,6 +1682,39 @@ void AbstractClient::setupWindowManagementInterface()
}
);
for (const auto &activity : m_activityList) {
w->addPlasmaActivity(activity);
}
// Notify clients on activities changes
connect(this, &AbstractClient::activitiesChanged, w, [w, this] {
const auto newActivities = m_activityList.toSet();
const auto oldActivities = w->plasmaActivities().toSet();
const auto activitiesToAdd = newActivities - oldActivities;
for (const auto &activity : activitiesToAdd) {
w->addPlasmaActivity(activity);
}
const auto activitiesToRemove = oldActivities - newActivities;
for (const auto &activity : activitiesToRemove) {
w->removePlasmaActivity(activity);
}
});
//Plasma Activities management
//show/hide when the window enters/exits activity
connect(w, &PlasmaWindowInterface::enterPlasmaActivityRequested, this,
[this] (const QString &activityId) {
setOnActivity(activityId, true);
}
);
connect(w, &PlasmaWindowInterface::leavePlasmaActivityRequested, this,
[this] (const QString &activityId) {
setOnActivity(activityId, false);
}
);
m_windowManagementInterface = w;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment