[x11window] Remove duplicate activities check
We check if activities are valid in Window::setActivities. We don't need to do it when we read the X11 properties.
This commit is contained in:
parent
ad95b495ac
commit
3649ec474b
1 changed files with 1 additions and 21 deletions
|
@ -2473,7 +2473,6 @@ Xcb::StringProperty X11Window::fetchActivities() const
|
||||||
void X11Window::readActivities(Xcb::StringProperty &property)
|
void X11Window::readActivities(Xcb::StringProperty &property)
|
||||||
{
|
{
|
||||||
#if KWIN_BUILD_ACTIVITIES
|
#if KWIN_BUILD_ACTIVITIES
|
||||||
QStringList newActivitiesList;
|
|
||||||
QString prop = QString::fromUtf8(property);
|
QString prop = QString::fromUtf8(property);
|
||||||
activitiesDefined = !prop.isEmpty();
|
activitiesDefined = !prop.isEmpty();
|
||||||
|
|
||||||
|
@ -2494,31 +2493,12 @@ void X11Window::readActivities(Xcb::StringProperty &property)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
newActivitiesList = prop.split(u',');
|
const QStringList newActivitiesList = prop.split(u',');
|
||||||
|
|
||||||
if (newActivitiesList == m_activityList) {
|
if (newActivitiesList == m_activityList) {
|
||||||
return; // expected change, it's ok.
|
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);
|
setOnActivities(newActivitiesList);
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(property)
|
Q_UNUSED(property)
|
||||||
|
|
Loading…
Reference in a new issue