Bug 461118

Summary: Proposal for improved keyboard navigation of KDE activities
Product: [Plasma] kwin Reporter: Richard J. Acton <richardjacton>
Component: activitiesAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: ericedlund2017, nate, niccolo.venerandi
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Richard J. Acton 2022-10-28 15:38:38 UTC
A common barrier to my really getting into using KDE activities is the difficulty of moving windows between activities, especially with the keyboard. Activities work well for desktop apps where I can set their default workspace but web browser windows are where it gets annoying for me. I find browser windows often have to activity switch and setting the appropriate visibilities is slow fiddly mouse work [^1]. Especially by comparison with moving a window between virtual desktops which can be easily bound.  

The closet thing that I could find to this suggestion here before was this bug report: https://bugs.kde.org/show_bug.cgi?id=271686 however this seems to miss the fact that windows can be in multiple activities as a commenter on that issue observed. To properly manage window activity visibility with the keyboard we need more than just the concept of 'move' window to activity but 'toggle window visibility in activity x'.

Consider this example set of keyboard shortcuts and actions:

- `Meta+Tab` - cycle activity  
- `Meta+Shift+<x>` where x indicates an activity e.g. I use `c` for communications, `m` for media etc.  
- `Meta+Shift+Ctrl+<x>` Toggle active window visibility in specified activity i.e. the activity with the `Meta+Shift+<x>` where x is the same  
	- Holding `Meta+Shift` could bring up a dialog over the active window like the current 'Show in activities' option in the rightclick on the titlebar dropdown.  
	- `Meta+Shift+Ctrl+a` could be used for 'show in all'  

This would need keyboard shortcuts for:  
	- 'toggle window visibility in activity x'  
	- 'make window visibility in all activities'  
	- It would also be nice to have 'make window exclusively visible in activity x' (maybe `Meta+Shift+Alt+<x>`)  this is the equivalent of 'move window to activity x'
	- Plus for ease keeping track of which activities a window is visible in the UI feature where the 'Show in activities' dialog pops up over the middle of the active window (when you hold `Meta+Shift` in my example).  So a keyboard shortcut for: "show 'Show in activities' for active window (while depressed)" 

This is more of a collection of feature requests to make a cohesive whole for a good experience quickly controlling window visibility in activities with the keyboard. 

A number of these are potentially slightly non-standard keyboard shortcuts as they may need to be aware that 'activity x' exists i.e. the shortcut for "move window to activity: 'x' " may need to be dynamically created when activity 'x' is created, though virtual desktops seem to get away with just having a bunch available even if they are not used so maybe that would work for activities too.

A keyboard shortcut which has the effect: "show 'Show in activities' for active window (while depressed)" Would also be useful for a 'hybrid' input mode where you use the keyboard to get the 'Show in activities' dialogue up and then click in the dialogue with the mouse as you can select windows of activities with the window and activity switchers (`Alt+Tab` & `Meta+Tab`). It still involves the mouse but has fewer steps than the `Alt+F3` approach.

It's quite a lot of stuff but I really think something like this is really needed to make activities viable for a more keyboard focused user.

[^1]: I know that you can do this with `Alt + F3` arrows keys space bar and return but in my experience this is quite flaky, the options are not changed when I try and toggle them with the spacebar and apply with return (at least on Plasma 5.25.5 on fedora 36 or 5.18.8 on ubuntu 20.04)
Comment 1 Eric Edlund 2022-11-03 02:29:50 UTC
This is interesting material. I threw this into the Activities group chat and we learned a few things which I will note here. 

Switching windows between activities is something we want design away from. The point of activities is to separate activities. The need to move windows between them will, of course, always be a need that we can't completely design away. Keyboard shortcuts may be a good idea.

We still have a lot to figure out about windows being on multiple activities in multiple desktops if activities end up having unique sets of VDs. It won't be an issue of just which activity but which desktop windows are shown on. Keeping the distinction between activities and desktops clear will be tricky.
Comment 2 Richard J. Acton 2022-11-03 17:29:47 UTC
(In reply to Eric Edlund from comment #1)
> This is interesting material. I threw this into the Activities group chat
> and we learned a few things which I will note here. 
> 
> Switching windows between activities is something we want design away from.
> The point of activities is to separate activities. The need to move windows
> between them will, of course, always be a need that we can't completely
> design away. Keyboard shortcuts may be a good idea.
> 
> We still have a lot to figure out about windows being on multiple activities
> in multiple desktops if activities end up having unique sets of VDs. It
> won't be an issue of just which activity but which desktop windows are shown
> on. Keeping the distinction between activities and desktops clear will be
> tricky.

Thanks Eric,

I'm new here so I'm not sure if this is suitable for a thread under the issue or might be better placed in the activities chat that you mentioned (is that a matrix room or something that I could join?) 

I don't generally like moving windows between activities either I prefer to have the right ones for the activities show up there by default in my preset kwin rules but as I mentioned web-browser windows always seems to end up being hard to pre-allocate to the right activity (at least for me) and then it's quite high friction to move them around, hence my interest in keyboard shortcuts to do so.

Activity specific VDs are not something I'd thought about up till now.
This is an example of how I've used activities and virtual desktops together that might be relevant for the separate VDs by activity question.
I usually have a 'comms' activity with all my email and chat clients.
I'll put my main email on my primary VD and my chat clients on another. 
But for example Discord is visible by default in both 'comms' and 'Gaming' activities because it's the chat client I'm most likely to use whilst gaming. 
However Discord is usually on my secondary VD in 'comms'. Though I'd prefer for Discord to be on my primary VD whilst gaming over on my second monitor so activity specific VD options and window associations could be good for this kind of situation.

Coming up with an intuitive default behaviour for a window made visible in an activity which has different VDs would be a challenge. Which VD(s) should it be visible on if there is no VD in common between the activities that they are visible on?

Maybe this is bad conceptual mapping though and I should have a different VD for comms in every activity tailored to the comms  tools needed in each activity not a central comms activity.
Comment 3 Eric Edlund 2022-11-04 15:29:59 UTC
Come bring that up in the matrix chat https://matrix.to/#/#kactivities:kde.org