From 0efbcdb1fad78283ed6e6fa38a63e30b10d7700f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 3 Oct 2011 17:12:07 +0200 Subject: [PATCH] optimize updateVisibility() when not showing the desktop --- client.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/client.cpp b/client.cpp index a6f0618641..72649c043d 100644 --- a/client.cpp +++ b/client.cpp @@ -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); }