Bug 510327

Summary: Feature request: add shortcut to switch to last virtual desktop
Product: [Plasma] kwin Reporter: Sam Crawford <samlkcrawford>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: kdedev, samlkcrawford
Priority: NOR    
Version First Reported In: 6.4.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sam Crawford 2025-10-06 23:12:59 UTC
Currently, all shortcuts for switching virtual desktops are either absolute (you specify which one exactly) or positional (up, right, down, left, previous, next).
In addition to those, I would like a "history" based switching, i.e. there is a (optional) shortcut to go to the last virtual desktop.

This would be useful, if you e.g. did not create an internal association of the contents of each virtual desktop with their individual shortcut, but keep having to switch back and forth between them. It would make dealing with that kind of situation easier, by taking over the job of memorising the concrete desktop you want to switch back to and instead use a dedicated shortcut to switch to the last desktop.

Concrete example:
You are using four virtual desktops, V1, V2, V3, V4.
You typically work on V1, however currently you are doing some side-task on V2. Related to this side-task, you switch to V3 to perform some sub-task. However, while you are processing this side-task, V4 requires your immediate attention, so you switch to V4. Once resolved, you want to get back to your tasks. So, which one was it? V1, V2 or V3? You might out of habit go to V1. Or you remember that you were working on a side task on V2 (even though you were not done with V3). Or (typically what I do) you just kind of guess/check on which desktop you were last working on, resulting in many (unnecessary) virtual desktop switches.
If I had the option to simply go back in my virtual desktop history, then using my configured shortcut, it would have switched me back to V3. Then, once I completed the sub-task on V3, I can use the shortcut once again to return to V2.

While this mainly describes a "Go to last desktop" shortcut, you could consider the complementary "Go to forward desktop" (could not think of a better description), to switch "forward" to the virtual desktop, from which you just switched back using the "Go to last desktop" shortcut.
Comment 1 TraceyC 2025-10-09 20:59:32 UTC
I can see the use case for it, but this might be complicated to implement, due to having to keep track of the last used desktop. I'll let the developers make that determination, tho.