Bug 394603

Summary: Don't put minimized windows to the end of ALT-TAB stack in MRU mode
Product: [Plasma] kwin Reporter: Alex <alex>
Component: tabboxAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: wishlist    
Priority: NOR    
Version First Reported In: 5.12.4   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alex 2018-05-23 10:15:14 UTC
Set "Recently used" for "Sort order" in Task Switcher options and then:
- open 3 windows (A, B, C) one after another
- minimize window C and windows B will become active
- press ALT-TAB and window A will become active

The desired behavior is to activate window C that was minimized. It is how Windows, MacOS and even Gnome will behave in that situation.

I understand that it could be done intentionally, but then could you please implement a checkbox in Task Switcher options to make it optional.

I am not alone asking for that feature. Here are some discussion threads:
https://forum.kde.org/viewtopic.php?t=101211
https://forum.kde.org/viewtopic.php?t=99625

Currently I have to apply the below patch and recompile KWIN every time I install KDE.
kwin/focuschain.cpp
@@ -235,17 +235,7 @@ Client *FocusChain::nextForDesktop(Client *reference, uint desktop) const
 void FocusChain::makeFirstInChain(Client *client, QList< Client * >& chain)
 {
     chain.removeAll(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);
-    }
+    chain.append(client);
 }
Comment 1 Martin Flöser 2018-05-23 15:36:37 UTC
This has always been like that. I don't see a reason to change given that you are the first to report this.
Comment 2 Alex 2018-05-23 16:04:57 UTC
I don't ask to change. Could you please add it as an option in Task Switcher? I am not alone requesting the feature (refer to the forums links I provided)
Comment 3 Martin Flöser 2018-05-23 17:51:59 UTC
We don't add random options, I'm sorry.