diff --git a/src/x11window.cpp b/src/x11window.cpp index 9cd83073a4..69e0bdcfa1 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -2473,7 +2473,6 @@ Xcb::StringProperty X11Window::fetchActivities() const void X11Window::readActivities(Xcb::StringProperty &property) { #if KWIN_BUILD_ACTIVITIES - QStringList newActivitiesList; QString prop = QString::fromUtf8(property); activitiesDefined = !prop.isEmpty(); @@ -2494,31 +2493,12 @@ void X11Window::readActivities(Xcb::StringProperty &property) return; } - newActivitiesList = prop.split(u','); + const QStringList newActivitiesList = prop.split(u','); if (newActivitiesList == m_activityList) { return; // expected change, it's ok. } - // otherwise, somebody else changed it. we need to validate before reacting. - // if the activities are not synced, and there are existing clients with - // activities specified, somebody has restarted kwin. we can not validate - // activities in this case. we need to trust the old values. - if (Workspace::self()->activities() && Workspace::self()->activities()->serviceStatus() != KActivities::Consumer::Unknown) { - QStringList allActivities = Workspace::self()->activities()->all(); - if (allActivities.isEmpty()) { - qCDebug(KWIN_CORE) << "no activities!?!?"; - // don't touch anything, there's probably something bad going on and we don't wanna make it worse - return; - } - - for (int i = 0; i < newActivitiesList.size(); ++i) { - if (!allActivities.contains(newActivitiesList.at(i))) { - qCDebug(KWIN_CORE) << "invalid:" << newActivitiesList.at(i); - newActivitiesList.removeAt(i--); - } - } - } setOnActivities(newActivitiesList); #else Q_UNUSED(property)