make minimized windows first of minimized

instead of last, causingding to  general LIFO

REVIEW: 110567
icc-effect-5.14.5
Thomas Lübking 2013-04-05 22:28:05 +02:00
parent e5028bb7fc
commit b3d8ce9044
3 changed files with 14 additions and 3 deletions

View File

@ -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);

View File

@ -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)

View File

@ -52,7 +52,8 @@ public:
enum Change {
MakeFirst,
MakeLast,
Update
Update,
MakeFirstMinimized = MakeFirst
};
virtual ~FocusChain();
/**