Bug 391174

Summary: Option to order Alt+tab menu items according to task manager arrangement
Product: [Plasma] kwin Reporter: Andrew <andrewnguyen841>
Component: tabboxAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: andreasgwilt, bugseforuns, ealefpereira, nate, plasma-bugs, salman.farooq3310
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Demonstration of issue, with alt+tab menu and task manager visible

Description Andrew 2018-02-27 17:45:17 UTC
Created attachment 111058 [details]
Demonstration of issue, with alt+tab menu and task manager visible

Cycling through tasks using alt+tab or shift+alt+tab currently does not reflect the order of the tasks on the task manager. In my task manager settings, I am using manual sorting and grouping by program name, but no matter what sorting order I choose or whether or not grouping is enabled, the alt+tab menu items are not in the same order as the task manager items.
Comment 1 Alef 2022-05-04 16:51:17 UTC
Made some analysis, found that this requires to add global shortcut keys in Plasma Workspace `shellcorona.cpp`. It seems that applets/widgets/plasmoids don't support global shortcut keys.

I found that for the `activateTaskAtIndex`, the global shortcut key is implemented in plasma workspace `shellcorona.cpp`, which calls the task bar `tools.js`/`activateTaskAtIndex` function. Here is the implementation: [https://github.com/KDE/plasma-workspace/blob/master/shell/shellcorona.cpp#L2254](https://github.com/KDE/plasma-workspace/blob/master/shell/shellcorona.cpp#L2254)

For this feature, I think the main change would be to create the global shortcut keys (walk taskbar window forward, walk taskbar window backward) in the `shellcorona.cpp` like the `activateTaskAtIndex` implementation and call the `tools.js`/`activateNextPrevTask` with their respective parameters.
Comment 2 Salman Farooq 2024-03-02 00:24:18 UTC
Hi, I am a software engineer and I would like to implement this feature because I have been wanting it for myself for a really long time. Though I have never developed Qt/KDE software before, I am up for the challenge. 

Can anybody guide me to any resources to setup a test environment where I can build and test my changes in code? Is a VM generally used? Also, any guidance for the Qt/KDE modules I should get familiar with to get started on this task? At the very least, I know there is a global shortcuts system I will need to know the API of.

Basically, I want 2 global shortcuts: one to move to the next (to the right or bottom) open application in the task manager and one for the previous (to the left or above). If everything goes smoothly, I will then handle the multi-row/column task managers as well but having the single row/column stuff working is my (as well as other people's I guess) priority.

Excited to do this!
Comment 3 Nate Graham 2024-03-04 19:52:45 UTC
Hi! Thanks a lot for volunteering to work on this. Our documentation can be found at https://community.kde.org/Get_Involved/development. Don't hesitate to reach out if you run into issues.