Use Meta+D to Show Desktop by default
ClosedPublic

Authored by ngraham on Mar 26 2019, 5:53 PM.

Details

Summary

Bind the keyboard shortcut Meta+D to Show Desktop.

Test Plan

Apply patch, compile KWin, do kwin --replace, reset KWin shortcuts to default values if you've previously changed the Show Desktop's keyboard shortcut

Meta+D now shows and hides the desktop.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Mar 26 2019, 5:53 PM
Restricted Application added a project: KWin. · View Herald TranscriptMar 26 2019, 5:53 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
ngraham requested review of this revision.Mar 26 2019, 5:53 PM
zzag added a subscriber: zzag.Mar 26 2019, 6:37 PM

Just out of curiosity, do other desktop environments have similar shortcut (to show desktop)?

Not sure about other Linux DEs, but I know that Windows has this shortcut by default, and macOS has a different shortcut to Show Desktop by default.

zzag added a comment.Mar 27 2019, 8:37 AM

Windows has this shortcut by default

Win+D?

filipf added a subscriber: filipf.Mar 27 2019, 8:49 AM
In D20066#439214, @zzag wrote:

Windows has this shortcut by default

Win+D?

Can confirm Win+D shows the desktop.

zzag accepted this revision.Mar 27 2019, 9:23 AM
This revision is now accepted and ready to land.Mar 27 2019, 9:23 AM
This revision was automatically updated to reflect the committed changes.

For what is worth to mention: we have for years refused to add further global shortcuts as they very easily conflict with application shortcuts. Yes, we were aware that people complained about the lack of default shortcuts. But on the other hand we get the bug reports about applications being broken. And I keep it with Linus: don't break user space. There's a reason why that shortcut didn't have a default and the windows shortcut existed back then.

Please think twice whether adding further global shortcuts is the right approach. Do we really have to copy all the windows shortcuts? What about osx? Do we have to copy those as well? We used to have a great feature to select the shortcut style. Maybe it's better to resurrect it instead of adding more and more global shortcuts.

zzag added a comment.Apr 1 2019, 8:45 PM

First of all, that's my fault and only mine. Sorry for that, I wasn't aware of this rule.

When I was about to accept this change, I considered potential conflicts between the new shortcut and applications. I couldn't find any application that uses Meta+ shortcuts. The main advantage of this change is that it makes plasma a bit familiar for windows users, also the choice of keys seems to be reasonable.

For what it's worth, I completely agree with this statement as well

don't break user space

because I know exactly how it feels when a window manager breaks your workflow (cough, Blender).

In either case, if it's very critical issue, we can revert this change (though I hope that we don't have to).

I agree that breaking userspace is bad. On the other hand, there is no indication that we have, and if an excessive fear of it prevents us from improving our own product, that we have broken ourselves by failing to have a product that conforms to modern user expectations. In general using the Meta key is expected these days to be used by "global" things such as those provided by the DE or the window manager, and if an application uses the meta key plus a letter, I think it's more correct to say that the app itself is broken and that should be changed there. I'm not aware of any conflicts that this causes, and users have been asking for it for years.

On the other hand you are stealing the shortcut even for users not using this feature at all. What about the following idea: if a user adds the show desktop widget the shortcut gets added?

And yes I'm sure that there are applications using this shortcut. The best case I saw was an application using ctrl+alt+f1 as a shortcut. That worked great on Linux...

If you add a shortcut it breaks someones workflow. You can count on it. You are just moving the frustration to some one else. If you think we need to have these shortcuts, that's fine to me. I'm no longer in charge, if you think it's needed that's ok. I just think we need to be a little bit smarter about adding the shortcut.

Thanks for voicing your opinion and staring your battle-tested wisdom. :) I think for now we will keep this and monitor the situation to see if we get user complaints and bug reports about it, and how many. Then at that point we can gauge what our response should be.

You are aware that kglobalaccel doesn't support removing global shortcuts? If yes your reply doesn't make any sense, if no it means you need to consider now - a revert later on based on feedback is not an available option.

You are aware that kglobalaccel doesn't support removing global shortcuts?

Can you expand upon why?

Can you expand upon why?

KGlobalaccel doesn't have information on what is set by a user and what was set by a script.
Also kconf_update and kglobalaccel are a nightmare - as you run kconf_update whilst kglobalaccel is running and then later kglobalaccel saves the config it had anyway.

So certainly reverting after public release would be a difficult thing - plus it's hard to do politically.
I assume Nate meant we check for feedback before release which would be fine.

Thanks. Having a two-level structure with system defaults (that can get updated via new versions) and static user-overrides would be nice, but I assume it's not easy to do with KGlobalaccel or a "replacement"?

I assume Nate meant we check for feedback before release which would be fine.

Right.

It seems like not being able to remove a system-default-but-not-user-created global shortcut is a bug that should be fixed. The two-level system with system defaults separated from user-created shortcuts is something that seems like it makes some sense.