From f18230fe99c6082dc0cda26d830f45c9404133da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 26 Aug 2012 16:16:38 +0200 Subject: [PATCH] ignore dockers for showingDesktop state also use a common funciton to decide whether or not to break the state BUG: 305874 FIXED-IN: 4.9.1 --- client.cpp | 28 ++++++++++++++++------------ client.h | 1 + manage.cpp | 11 +---------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/client.cpp b/client.cpp index c9180c0ac6..ab9a5f576b 100644 --- a/client.cpp +++ b/client.cpp @@ -1212,21 +1212,25 @@ void Client::updateVisibility() internalHide(Allowed); return; } - if (isManaged() && 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); - } + resetShowingDesktop(true); internalShow(Allowed); } + +void Client::resetShowingDesktop(bool keep_hidden) +{ + if (isDock() || !workspace()->showingDesktop()) + return; + bool belongs_to_desktop = false; + for (ClientList::ConstIterator it = group()->members().constBegin(), + end = group()->members().constEnd(); it != end; ++it) + if ((belongs_to_desktop == (*it)->isDesktop())) + break; + + if (!belongs_to_desktop) + workspace()->resetShowingDesktop(keep_hidden); +} + /** * Sets the client window's mapping state. Possible values are * WithdrawnState, IconicState, NormalState. diff --git a/client.h b/client.h index 4c33ab4fdb..897db58eca 100644 --- a/client.h +++ b/client.h @@ -682,6 +682,7 @@ private: bool processDecorationButtonPress(int button, int state, int x, int y, int x_root, int y_root, bool ignoreMenu = false); Client* findAutogroupCandidate() const; + void resetShowingDesktop(bool keep_hidden); protected: virtual void debug(QDebug& stream) const; diff --git a/manage.cpp b/manage.cpp index 4b3ec7cd2b..ddeca11416 100644 --- a/manage.cpp +++ b/manage.cpp @@ -558,16 +558,7 @@ bool Client::manage(Window w, bool isMapped) } } - 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(options->isShowDesktopIsMinimizeAll()); + resetShowingDesktop(options->isShowDesktopIsMinimizeAll()); if (isOnCurrentDesktop() && !isMapped && !allow && (!session || session->stackingOrder < 0)) workspace()->restackClientUnderActive(this);