Add spatial window sorting mode for tasks (in task managers)
Paired with plasma-desktop!2784
Reason for the change
This proposed change has some discussion at https://bugs.kde.org/show_bug.cgi?id=499175 .
Currently, when a user chooses to sort a task manager's tasks by desktop, there is no user-visible explanation or guarantee of how windows on the same desktop are sorted, but the logic does fall through to other mechanisms.
This change adds a new first-step fall-through sorting mechanism in that case: sort by window position (x,y coordinates).
Windows to the left come before windows on the right, and windows at the top come before windows at the bottom. If windows have identical coordinates, the logic falls through further, as before.
Windows on separate virtual desktops are sorted by virtual desktop.
- This brings unity to the arrangement of windows and their task entries in the task manager.
- When the task manager is scrolled over, the window focus steps in a continuous direction and path, rather than jumping around. This applies to vertical task managers as well as horizontal.
- When windows are side by side (and my have the same task icon), it becomes possible to determine which task entry corresponds to which window.
- When using a tiling KWin script like Karousel which places windows off-screen, either to the left or right, the task manager communicates the placement. It becomes a mini-map of the windows.
Test plan
I've only tested by using this, with and without Karousel, scrolling over the task managers, rearranging windows, etc.
The task manager(s) must be set to sort by virtual desktop window position to see this in action.
Screenshots or screen recordings
Before | After |
---|---|
BEFORE | AFTER |
Note: Any jittering of the panel in the videos is not related to this change, and often happens, probably related to the panel resizing to fit content, and the global menu applet.
The effect and benefit is more dramatic with Karousel or a similar tiling workflow, but I didn't include that in the demo videos because that won't affect most users.