optimize updateVisibility() when not showing the desktop

This commit is contained in:
Luboš Luňák 2011-10-03 17:12:07 +02:00
parent b6478e1b12
commit 0efbcdb1fa

View file

@ -1140,16 +1140,18 @@ void Client::updateVisibility()
internalHide(Allowed);
return;
}
bool belongs_to_desktop = false;
for (ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().constEnd();
++it)
if ((*it)->isDesktop()) {
belongs_to_desktop = true;
break;
}
if (!belongs_to_desktop && workspace()->showingDesktop())
workspace()->resetShowingDesktop(true);
if( workspace()->showingDesktop()) {
bool belongs_to_desktop = false;
for (ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().constEnd();
++it)
if ((*it)->isDesktop()) {
belongs_to_desktop = true;
break;
}
if (!belongs_to_desktop)
workspace()->resetShowingDesktop(true);
}
internalShow(Allowed);
}