Commit 0dd927c4 authored by David Edmundson's avatar David Edmundson
Browse files

Validate activities in setOnActivities

Summary:
This fixes a bug I had where Session Management restored a window on an
activity that didn't exist that, meaning I was unable to access it.

setOnActivity() already has this check

BUG: 362620

Test Plan:
Using my broken session, restored and got my ghost process back
on all activities

Added a window to activity 2, checked it came back there and
only there.

Reviewers: #plasma, graesslin

Subscribers: ivan, luebking, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D1982
parent b1461899
......@@ -1240,6 +1240,16 @@ void Client::setOnActivities(QStringList newActivitiesList)
newActivitiesList = joinedActivitiesList.split(u',', QString::SkipEmptyParts);
QStringList allActivities = Activities::self()->all();
auto it = newActivitiesList.begin();
while (it != newActivitiesList.end()) {
if (! allActivities.contains(*it)) {
it = newActivitiesList.erase(it);
} else {
it++;
}
}
if (// If we got the request to be on all activities explicitly
newActivitiesList.isEmpty() || joinedActivitiesList == Activities::nullUuid() ||
// If we got a list of activities that covers all activities
......
Markdown is supported
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