Add default shortcut to switch to the desktop to the left/right/top/bottom
Needs ReviewPublic

Authored by GB_2 on Sep 28 2019, 10:31 AM.

Details

Summary

Same as on Windows 10, very useful when you use virtual desktops.

Test Plan

Have 2 or more virtual desktops and use the new shortcut.

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 17327
Build 17345: arc lint + arc unit
GB_2 created this revision.Sep 28 2019, 10:31 AM
Restricted Application added a project: KWin. · View Herald TranscriptSep 28 2019, 10:31 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
GB_2 requested review of this revision.Sep 28 2019, 10:31 AM
romangg requested changes to this revision.Sep 28 2019, 1:33 PM
romangg added a subscriber: romangg.

I'm in favor of adding new shortcuts but I want to see a full usability concept on how they are meant to work together with existing ones and how the user interaction is supposed to look. Just copying patterns from other systems is not sufficient.

For example I have set my VD switching keys to Meta + WASD (and move window to VD to Shift + Meta +WASD) because that way I can switch without taking my right hand from the mouse. That's only my personal preference and comes from me using it very often. But similar thought including an usage analysis must be put into an overall concept when changing or setting new default keys. Because you should do it only once.

This revision now requires changes to proceed.Sep 28 2019, 1:33 PM

+1 for setting default shortcuts for this.

In general, apps don't use the Meta key for their shortcuts, while the shell does. As far as I know this is not a formal standard, but rather a de-facto one. I think it would benefit us to formally settle on this ourselves, or else we'll have the same conversation every time someone proposes adding a new global shortcut.

thiagosueto added a subscriber: thiagosueto.EditedOct 3 2019, 1:46 PM

My take on this:

One issue I experienced while assigning "Switch to VD above/below/left/right" and "Switch to next/previous VD" myself is that the 4 arrow keys are incredibly valuable for desktop environments that use a 2D VD model, that is, environments where you can switch between two axes, up/down and left/right. In addition, arrow keys are close both in semantic and physical manner, which makes them perfect for 2D navigation with windows and VDs. The issue here is that if you set "Switch to next/previous VD" to arrow keys, "Switch to VD above/below/left/right" can't make use of arrow keys.

Windows, OSX, i3 and GNOME all use a 1D model for virtual desktops. I believe keyboard shortcuts should be assigned in accordance to the model the desktop environment uses; that can of course have exceptions, for instance, for the sake of familiarity (which is the case) though I'm not fond of using just familiarity as a reason for this sort of change.

This sort of combo (Ctrl+Meta+arrow) makes sense, but if you set it for Next/Previous, you'd be missing the opportunity of setting the entirety of the four arrow keys to a set of four close functionalities, namely Switch to VD above/below/left/right, and would require setting the combo Ctrl+Meta+up/down to something else which has 2 similar functionalities instead of four. The problem with this is that there isn't a pair of keys on the keyboard that would work well with Next/Previous aside from Left/Right. PageUp and PageDown, for instance, would typically be expected to descend immediately below and above like in GNOME, not e.g. switching diagonally if the user has 4 VDs or more.

What can be done in order for this to make sense in Plasma's context is also set Switch One Desktop Up and Switch One Desktop Down since, analogously, Next/Previous and left/right usually intersect, but that is rather clunky. What if the user has 6 VDs arranged like 1, 2, 3 on the upper side and 4, 5, 6 on the lower side, and want to switch from 6 to 4 using Switch One Desktop Right? It might also be more intuitive to set up/down/left/right instead of up/down/Previous/Next, especially if the user prefers to use a vertical VD layout (users coming from GNOME might like this), in which case using the left and right keys make no sense for transitioning between desktops.

A rebuttal to my criticism of up/down/left/right being more intuitive is that intuitiveness can also be broken for the "better option", like GNOME devs usually affirm. For instance, they have Meta+Left/Right for snapping windows, but Meta+Up/Down for maximizing/restore, which breaks the intuitiveness of snap up/down/left/right because snapping a window up or down is either niche or is not the best arrangement of windows if your screen monitor isn't huge, and because maximize/restore are way more used functionalities.

Anyway, this is one of those keyboard shortcut changes that must be taken as a whole instead of in small parts. Could decision-making on this be postponed at least a week? I was going to more accurately address these things with my posts on GNOME soon. This requires discussion first.

EDIT: corrected dimension numbers

That's an excellent point, @thiagosueto, and one I hadn't considered.

Maybe we could use the PageUp/PageDown keys with some combination of modifiers for next/previous virtual desktop?

GB_2 updated this revision to Diff 67316.Oct 4 2019, 11:18 AM

Set left/right/up/down action shortcut instead

GB_2 retitled this revision from Add default shortcut to switch to next/previous desktop to Add default shortcut to switch to the desktop to the left/right/top/bottom.Oct 4 2019, 11:21 AM
ngraham accepted this revision.Oct 4 2019, 11:42 AM

This makes sense to me.

Why not meta+wasd for example?

WASD is something that only gamers know. IMO it's not an appropriate default for regular users.

GB_2 added a comment.EditedOct 4 2019, 11:58 AM

Why not meta+wasd for example?

  • WASD isn't really used anywhere in Plasma or other desktops/operating systems, but in games
  • WASD is much less clearer than the arrows and we already use the arrow keys for other functions
  • this patch has the same shortcut as on Windows, so people will be familiar with it

We don't need to copy other systems all the time. We can establish our own patterns when it makes sense.

And as long as we do that in a holistic way, i.e. not through singular patches without overall plan changing one default at a time.

That wasd pattern is not used in Plasma but in games is not a counterargument but only shows:

  1. That we might miss out here on something
  2. That it's a proven concept.

Also I don't like overloading the arrow keys with functionality such that you need to remember unrelated modifier keys for when does it what.

If Microsoft does it they are free to do it, but it's still bad.

We don't need to copy other systems all the time. We can establish our own patterns when it makes sense.

I agree. I fear it might be too niche, but on the other hand, this might make Plasma more interesting for gamers.

And as long as we do that in a holistic way, i.e. not through singular patches without overall plan changing one default at a time.

Yes, this sort of keyboard shortcut must be decided on a later date, me thinks.
My bad though: I mentioned it makes sense, but this statement is empty without justification. I was envisioning something like:

  • Meta+arrow = snapping windows
  • Meta+Ctrl+arrow = switch to VD (because it changes where you start managing windows)
  • Meta+Shift+arrow = move window between screens (because the window gets transferred)
  • Meta+Alt+arrow = change focus between windows (because it changes their state)

This should be discussed and counterpoints should be made though. For instance:

Also I don't like overloading the arrow keys with functionality such that you need to remember unrelated modifier keys for when does it what.

This is my fear as well.

We don't need to slavishly copy other platforms, that's true. But we should also be wary of deviating too far from the familiar. Both can be a failure mode, depending on the circumstance.

I can see the appeal of Meta+WASD. It's a very efficient single-hand keyboard shortcut combo that cleverly re-uses a directional metaphor popularized by video games. It feels "unique" and if it gets implemented and gains popularity, the kinds of people who read tech blogs and try Linux distros for fun will remark, "hey, that's kind of clever."

But like all trade-offs between efficiency and accessibility, you need to strike a balance appropriate to your audience. Cleverness that's lost on or inaccessible to your users isn't actually clever at all. There's a reason why most default settings are kind of dumb and not tuned for maximum efficiency: because they're more approachable and discoverable.

Now, we're talking about virtual desktop switching keyboard shortcuts. Ordinary users don't use virtual desktops and don't use many keyboard shortcuts outside of cut/copy/paste. So our audience is already far above average technically. So we should ask: what keyboard shortcut is this audience most likely to 1) discover and 2) appreciate?

Being a clever single-handed combo, Meta+WASD actually seems quite easy to appreciate for me, so we have #2 already. However the trick is discovering it in the first case (#1). The only visible UI by which you can discover this shortcut is in the Global Shortcuts KCM which has awful usability and in general people don't trawl through it to find shortcuts. So it should be discoverable through trial and error. The question is, will people discover Meta+WASD through trial and error?

To my knowledge no other keyboard shortcut uses this pattern (using the WASD keys as a substitute for the arrow keys), so it's not going to be on the top of people's minds. By contrast the arrow keys are used on all other platforms, with some combination of modifier keys. Speaking personally, if I was trying to discover a platform's virtual desktop keyboard shortcuts, I would do the following:

  1. Meta+arrows (seems intuitive, I have a concept that Meta is for global shortcuts and the arrow keys are commonly used with modifier keys for switching virtual desktops)
  2. If that didn't work, Meta+Ctrl+arrows. This is what Windows does, and we already implement a few Windows shortcuts, so it doesn't seem implausible)
  3. If that didn't work, Meta+Alt+arrows
  4. I would not try Alt+arrows because I know Alt+left arrow is used for "Back" in web browsers and Dolphin, so it can't be a valid global shortcut
  5. I would not try Ctrl+arrows because even though it's what macOS uses, I know that this keyboard shortcut combination is used for moving the insertion point in a text editor on this platform
  6. I would not try any combination of modifier keys + WASD; it would never occur to me, because "use the WADS keys" is in my mental bucket for video games, not using a desktop environment. Those keys are the first thing I would try in a first-person video game, but the last thing I would try outside of it.

Anyway, I'm not formally objecting, because having a global shortcut (practically any global shortcut) is good. But I also know that once we set one of these, people get mad if we change it again, so we should try to avoid the "implement it and see if it works, and change it if it doesn't" dance that we can get away with for some other things.

One thing of note that is set by default on both XFCE and GNOME is Ctrl+Alt+arrows for moving between workspaces: in GNOME Ctrl+Alt+Up/Down switches between workspaces vertically and XFCE uses Ctrl+Alt+Up/Down/Left/Right to switch between workspaces both vertically and horizontally. Since we're switching to Meta as default for system/shell/desktop shortcuts, could Ctrl+Alt+arrows be set as an alternative (as Plasma allows for two keyboard shortcuts for the same action through the GUI)?

Purely as an observation this will break any user that has:
https://github.com/lingtjien/Grid-Tiling-Kwin

It's not part of KDE by default, but then nor is having more than one virtual desktop.