From b3d8ce904431a28530475366f68df27b0b987077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 5 Apr 2013 22:28:05 +0200 Subject: [PATCH] make minimized windows first of minimized instead of last, causingding to general LIFO REVIEW: 110567 --- client.cpp | 2 +- focuschain.cpp | 12 +++++++++++- focuschain.h | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/client.cpp b/client.cpp index 451714f10f..23de020eff 100644 --- a/client.cpp +++ b/client.cpp @@ -880,7 +880,7 @@ void Client::minimize(bool avoid_animation) updateAllowedActions(); workspace()->updateMinimizedOfTransients(this); updateWindowRules(Rules::Minimize); - FocusChain::self()->update(this, FocusChain::MakeLast); + FocusChain::self()->update(this, FocusChain::MakeFirstMinimized); // TODO: merge signal with s_minimized emit clientMinimized(this, !avoid_animation); diff --git a/focuschain.cpp b/focuschain.cpp index fdb2adc605..bd98b94abb 100644 --- a/focuschain.cpp +++ b/focuschain.cpp @@ -235,7 +235,17 @@ Client *FocusChain::nextForDesktop(Client *reference, uint desktop) const void FocusChain::makeFirstInChain(Client *client, QList< Client * >& chain) { chain.removeAll(client); - chain.append(client); + if (client->isMinimized()) { // add it before the first minimized ... + for (int i = chain.count()-1; i >= 0; --i) { + if (chain.at(i)->isMinimized()) { + chain.insert(i+1, client); + return; + } + } + chain.prepend(client); // ... or at end of chain + } else { + chain.append(client); + } } void FocusChain::makeLastInChain(Client *client, QList< Client * >& chain) diff --git a/focuschain.h b/focuschain.h index 2e64b2f0b8..3eed84eb64 100644 --- a/focuschain.h +++ b/focuschain.h @@ -52,7 +52,8 @@ public: enum Change { MakeFirst, MakeLast, - Update + Update, + MakeFirstMinimized = MakeFirst }; virtual ~FocusChain(); /**