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); internalHide(Allowed);
return; return;
} }
bool belongs_to_desktop = false; if( workspace()->showingDesktop()) {
for (ClientList::ConstIterator it = group()->members().constBegin(); bool belongs_to_desktop = false;
it != group()->members().constEnd(); for (ClientList::ConstIterator it = group()->members().constBegin();
++it) it != group()->members().constEnd();
if ((*it)->isDesktop()) { ++it)
belongs_to_desktop = true; if ((*it)->isDesktop()) {
break; belongs_to_desktop = true;
} break;
if (!belongs_to_desktop && workspace()->showingDesktop()) }
workspace()->resetShowingDesktop(true); if (!belongs_to_desktop)
workspace()->resetShowingDesktop(true);
}
internalShow(Allowed); internalShow(Allowed);
} }