Expose more default window management shortcuts
ClosedPublic

Authored by ngraham on Mar 16 2018, 4:49 AM.

Details

Summary

KWin's window management powers are not as discoverable as they could be--particularly tiling, which by default has no visible UI and no keyboard shortcuts. Resolving this issue is highly relevant to T6831: Top-notch usability and productivity for basic software.

This patch re-assigns the Meta+arrowkeys shortcuts that are currently used for move zoomed area (which are pretty esoteric, infrequently-used actions), adding ctrl to their shortcuts. This allows us to use their valuable Meta+arrowkeys for more useful and commonly-used window management actions:

  • Meta+: quick tile window to the left
  • Meta+: quick tile window to the right
  • Meta+: quick-tile window to the top
  • Meta+: quick-tile the window to the bottom

The patch also sets some default shortctuts for minimize and maximize:

  • Meta+PageDown: minimize window
  • Meta+PageUp: maximize/de-maximize the window
Test Plan

Do a clean build
make test (no new test failures)
Reboot
Create and log into a new user account

  • meta+ tiles the active window to the top
  • meta+ tiles the active window to the bottom
  • meta+ tiles the active window to the left
  • meta+ tiles the active window to the right
  • meta+PageDown minimizes the active window
  • meta+PageUp maximizes and de-maximizes the active window
  • meta+ctrl+ moves the zoomed area up
  • meta+ctrl+ moves the zoomed area down
  • meta+ctrl+ moves the zoomed area to the left
  • meta+ctrl+ moves the zoomed area to the right

Diff Detail

Repository
R108 KWin
Branch
more-default-window-management-shortcuts (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham created this revision.Mar 16 2018, 4:49 AM
Restricted Application added a project: KWin. · View Herald TranscriptMar 16 2018, 4:49 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
ngraham requested review of this revision.Mar 16 2018, 4:49 AM
ngraham edited the summary of this revision. (Show Details)Mar 16 2018, 4:53 AM
ngraham edited the test plan for this revision. (Show Details)

+1!

One of the more frequently asked questions I get when introducing people to Plasma is "how can I arrange windows left or right with Meta+arrow keys?"

There is also a quick tile up, down. Staying consistent and using Meta+ for up and Meta+ for down tiling would make sense, although minimize and maximize are of course more important. Maybe for minimize we could then use Meta+X and Meta+C, which you can reach just with one hand. Or other suggestions?

Best would be if one could then top tile left for example by pressing Meta++. But I assume our current system doesn't allow this easily.

mart added a subscriber: mart.Mar 16 2018, 10:00 AM

meta+x could somehow suggest "close" as the close button looks like an x?

meta+x could somehow suggest "close" as the close button looks like an x?

-1. Alt+F4 is common knowledge and Meta+X is the "Window Mobility Center" (if that is still a thing in Window 10), I could imagine laptop assigning random keys to emit that (like they do with Meta+P)

ngraham added a comment.EditedMar 16 2018, 2:05 PM

+1!

One of the more frequently asked questions I get when introducing people to Plasma is "how can I arrange windows left or right with Meta+arrow keys?"

Same here! I think it's a very common papercut/wish.

There is also a quick tile up, down. Staying consistent and using Meta+ for up and Meta+ for down tiling would make sense, although minimize and maximize are of course more important. Maybe for minimize we could then use Meta+X and Meta+C, which you can reach just with one hand. Or other suggestions?

I deliberately didn't make Meta+ and Meta+ do top/bottom tiling for the following reasons:

  • Minimize and maximize seem more commonly-used and useful
  • Many apps aren't well-optimized for being rendered 2 or 3 times wider than they are tall, so only in a few circumstances is it actually useful
  • Consistency with other platforms

That said, I'd be fine with adding alternative default shortcuts for top/bottom tiling; maybe Meta+PageUp and Meta+PageDown?

Best would be if one could then top tile left for example by pressing Meta++. But I assume our current system doesn't allow this easily.

Yes, that would be ideal. A friend who I'm trying to tempt away from Linux Mint keeps asking for this (they have it in Cinnamon). I think Windows does this, too. Out of scope for this patch, but something to keep in mind as a wishlist for the future.

Another thing I just thought of is that not exposing the top and bottom tiling actions via common meta shortcuts mirrors the mouse-based tiling UI: you can drag to the sides of the screen to side-tile a window, but dragging to the top maximizes (and dragging to the bottom does nothing).

romangg requested changes to this revision.Mar 16 2018, 7:45 PM

Another thing I just thought of is that not exposing the top and bottom tiling actions via common meta shortcuts mirrors the mouse-based tiling UI: you can drag to the sides of the screen to side-tile a window, but dragging to the top maximizes (and dragging to the bottom does nothing).

What is imo a deficiency. I remember when I switched from Linux Mint to Neon years back this was one of the few features I missed (at least dragging to bottom should induce a tiling).

Regarding this patch here: Your arguments for breaking the systematic with maximizing/minimizing on Meta+ / don't convince me. Your first one I mentioned myself, but the page keys you brought up would be a perfect fit for that. The second argument is irrelevant on its own. It just might explain the first one. The third one is only of relative importance. If we have to decide on an in itself coherent system in our software or an incoherent one in order to be consistent with incoherent systems of other software, the decision is not hard.

If Meta+ for top and Meta+ for bottom tiling is something you can accept for your patch we can merge it and later try to implement pressing combinations for quick tiling top left, top right etc. Not sure if this will be easy to achieve with our current shortcut system though.

You can also directly add to this patch Meta+PageUp / PageDown for maximizing/minimizing windows.

This revision now requires changes to proceed.Mar 16 2018, 7:45 PM

If Meta+ for top and Meta+ for bottom tiling is something you can accept for your patch we can merge it and later try to implement pressing combinations for quick tiling top left, top right etc. Not sure if this will be easy to achieve with our current shortcut system though.

You can also directly add to this patch Meta+PageUp / PageDown for maximizing/minimizing windows.

OK, I can accept that!

ngraham updated this revision to Diff 29714.Mar 16 2018, 10:43 PM

Expose all four edge tiling modes, and use different shortcuts for maximize/minimize

romangg accepted this revision.Mar 16 2018, 10:48 PM
This revision is now accepted and ready to land.Mar 16 2018, 10:48 PM
ngraham edited the summary of this revision. (Show Details)Mar 16 2018, 11:06 PM
ngraham edited the test plan for this revision. (Show Details)
ngraham closed this revision.Mar 16 2018, 11:19 PM
graesslin reopened this revision.Mar 17 2018, 11:16 AM
graesslin added a subscriber: graesslin.

Please also add a kconf update script to reassign the shortcuts. Also please add unit tests for the new shortcuts.

effects/zoom/zoom.cpp
85–87

please remove those shortcuts. It's totally useless that an effect takes those shortcuts.

This revision is now accepted and ready to land.Mar 17 2018, 11:16 AM

Please also add a kconf update script to reassign the shortcuts. Also please add unit tests for the new shortcuts.

Will add unit tests in a follow-up patch.

The idea was that this should only change the defaults for new installs and people who didn't already change the defaults. Are you sure it's a good idea to change people's pre-existing shortcuts?

Please also add a kconf update script to reassign the shortcuts. Also please add unit tests for the new shortcuts.

Will add unit tests in a follow-up patch.

The idea was that this should only change the defaults for new installs and people who didn't already change the defaults. Are you sure it's a good idea to change people's pre-existing shortcuts?

In this case y

Please also add a kconf update script to reassign the shortcuts. Also please add unit tests for the new shortcuts.

Will add unit tests in a follow-up patch.

The idea was that this should only change the defaults for new installs and people who didn't already change the defaults. Are you sure it's a good idea to change people's pre-existing shortcuts?

In this case yes. I doubt anybody used those shortcuts. They were added years ago in an attempt to make zoom effect more usable for accessibility. What that attempt ignored was that the zoom effect is unsuited for accessibility from a conceptional perspective. So I doubt that users use the zoom effect for accessibility and thus nobody uses those shortcuts. Removing those shortcuts would only affect a small userbase. In comparison the default shortcut for zoom doesn't even work on many keyboard layouts such as German. So a shortcut for a feature whose shortcut doesn't work.

The shortcuts should have never been added in the first case. An optional feature of an optional feature should not have default global shortcuts. We unfortunately have more such cases in KWin and some are also my own fault.

zzag added a subscriber: zzag.EditedMar 17 2018, 9:22 PM

In this case yes. I doubt anybody used those shortcuts.

Well, I use those shortcuts.

This will break users' custom shortcuts so please don't do that.

ngraham added a comment.EditedMar 18 2018, 4:42 AM

It looks like the current quick tiling shortcuts (if any) are already tested in QuickTilingTest::testShortcut(), and the tests pass:

PASS   : KWin::QuickTilingTest::testShortcut(top)
PASS   : KWin::QuickTilingTest::testShortcut(left)
effects/zoom/zoom.cpp
85–87

So you would like for the move zoomed area actions to have no default shortcuts at all?

It looks like the current quick tiling shortcuts (if any) are already tested in QuickTilingTest::testShortcut(), and the tests pass:

PASS   : KWin::QuickTilingTest::testShortcut(top)
PASS   : KWin::QuickTilingTest::testShortcut(left)

Perfect!

effects/zoom/zoom.cpp
85–87

Yes, exactly

OK, so in conclusion:

  • I will make a new patch that removes the shortcuts for "move zoomed area" for new installs
  • Changing the shortcuts for current users is controversial; needs more discussion? I see both sides.

Submitted a follow-up patch to remove the Move zoomed area shortcuts: D11526, as requested.

broulik accepted this revision.Tue, Mar 27, 3:42 PM

Unless Martin objects

This was already committed, FWIW. It's only been re-opened because Martin had a few remaining requests, one of which I've already taken care of. The only remaining request is for a kconf update script to force the use of the new shortcuts, which was controversial, and I haven't done it yet because we didn't have a complete a discussion about it.

zzag added a comment.EditedTue, Mar 27, 4:08 PM

This was already committed, FWIW. It's only been re-opened because Martin had a few remaining requests, one of which I've already taken care of. The only remaining request is for a kconf update script to force the use of the new shortcuts, which was controversial, and I haven't done it yet because we didn't have a complete a discussion about it.

It's a little bit against typical "policies" on users' configs, e.g. don't screw them up. In addition to that, this change hadn't introduced breaking changes so configs should be migrated.

Never having written one before, I can't answer those questions, but hopefully someone else can.

zzag added a comment.Tue, Mar 27, 4:55 PM

Never having written one before, I can't answer those questions, but hopefully someone else can.

I'd deleted that question because it was stupid.

Anyways, there is no clear reason to mess users' configs.

The idea of mapping Meta+/Meta+ to maximize/minimize is pretty convenient. Here's a scenario: Say one wants to maximize the window tiled to the left, which one feels more convenient, Meta+ or Meta+PgUp?

I think the former. One can navigate between different window states using Meta and the arrow keys as oppose to tile to top and tile to bottom which don't work with some applications (on a 15.6 in screen), KDevelop, Telegram and Systems Settings for example, which have fixed heights.

ngraham closed this revision.Sun, Apr 8, 9:01 PM

This is done. If there's a desire to revisit the decision not to use Meta+ and Meta+ and Maximize and Minimize, we can do that in the discussion for another patch, potentially.