Skip to content

Draft: Add ability to sort windows by reverse stack order

In some cases, sorting windows in the task switcher by recently used can have unexpected behavior - for example, if hover-to-focus is enabled. This commit adds the ability to sort by the top to bottom window stack order ("reversed" window stack), which has more intuitive and predictable behavior in these corner cases.

Example case: when using hover-to-focus, if your cursor passes over a background window when moving between two foreground windows, the background window will grab focus and KWin considers this "using" the window for the purposes of the recently used stack ordering, so an alt-tab (task switcher activation) will take you to the background window, which is almost certainly undesirable.

The ideal resolution might be not adding a window to the recently used stack unless it receives a click or keyboard input, but checking for this is harder than just using the reversed window stack order.

Fixes https://bugs.kde.org/show_bug.cgi?id=443237

Merge request reports