Bug 371560 - Drop KWin's global modifier-only key handling in favor of setting individual modifier keys as shortcuts where applicable (e.g. for Kickoff)
Summary: Drop KWin's global modifier-only key handling in favor of setting individual ...
Status: ASSIGNED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
: 447167 449959 472826 (view as bug list)
Depends on: 472679
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-24 09:37 UTC by Najjar
Modified: 2024-02-22 02:50 UTC (History)
16 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
UI to explicitly reveal and configure the Meta/Win key activating Application Launcher (39.78 KB, image/png)
2021-01-07 23:50 UTC, skierpage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Najjar 2016-10-24 09:37:20 UTC
I get that the meta key is used in Windows, and so new users expect it to work that way in Plasma too. I'm an old time user, and I haven't used Windows in years. I don't like that meta now kicks off Kickoff

I bind meta+[key] to a number of tasks and applications, and if I change my mind about that (I start pressing meta, but then decide "nah") the launcher appears. And it doesn't hide when meta is pressed again (bug 367685)

If KDE is adamant on having the meta key kickoff behavior as default, add an option to disable that. If not, then disable that behavior by default, and add an option to enable it for those who'd like it.

Reproducible: Always
Comment 1 Tony 2016-10-29 13:15:48 UTC
There is already one, remove ALT+F1 shortcut from the application launcher.

Although it would be nice to have one on system settings like "Numlock on plasma startup".
Comment 2 Peter Wu 2016-11-08 23:15:18 UTC
(In reply to Tony from comment #1)
> There is already one, remove ALT+F1 shortcut from the application launcher.

The problem is that both "Meta" and "Alt+F1" open the Kickoff menu. The expected behavior is that only "Alt+F1" should open the Kickoff menu. How would removing the "Alt+F1" shortcut help in this case?
Comment 3 Peter Wu 2016-11-11 14:31:44 UTC
Ok, apparently it has to be configured in KWin. Not the first place to expect such an option though.

Based on the linked Reddit post in https://blog.martin-graesslin.com/blog/2016/08/modifier-only-shortcuts-available-in-plasma-5-8/#comment-72021, it appears that you have to manually modify ~/.config/kwinrc and append:

[ModifierOnlyShortcuts]
Meta=

(then press Alt-F2 to get KRunner and execute "kwin_x11 --replace" to reload the configuration. Alternatively, log out, change the file and login.)
Comment 4 azrdev 2016-11-14 16:45:34 UTC
I had replaced (via the systemsettings GUI) the Kickoff-toggling shortcut Alt-F1 by Meta-Space. With plasma 5.8 this still worked, but pressing Meta now also opened the Kickoff (but cannot close it: <https://bugs.kde.org/show_bug.cgi?id=372477>).
Removing the custom shortcut Meta-Space with systemsettings removes *both* shortcuts at once, i.e. neither Meta nor Meta-Space open/toggle the Kickoff anymore.
Comment 5 Nate Graham 2018-10-20 15:59:20 UTC
When Alt+F1 is configured as the shortcut, KWin automatically binds Meta too. Removing the Alt+F1 hotkey will make the Meta key stop opening it.
Comment 6 Sasha Unspecified 2018-11-10 11:01:19 UTC
Why is it marked as "resolved"? The Application Menu clearly has to have an **intuitive** way to disable its opening on release of the Meta key (but **without** unassigning the Alt+F1 shortcut, which is **unrelated** to the Meta-key shortcut from user's perspective). I suppose, there should be a checkbox for that in Application Menu Settings (currently there is a "Keyboard shortcuts" section in Application Menu Settings, but it allows only to change/reassign regular (on-key-down) shortcut, but not to assign/unassign on-key-up-style Meta-key shortcut).
Comment 7 Peter Wu 2018-11-10 12:08:27 UTC
(In reply to Sasha Unspecified from comment #6)
> Why is it marked as "resolved"?

See comment 3 for a way to disable Meta while preserving Alt+F1. Still works for me with plasma-desktop 5.14.3. Granted, it is not intuitive but it is possible to configure the setting.
Comment 8 Sasha Unspecified 2018-11-10 15:35:24 UTC
I know that. But that's not a user-friendly way. That setting should be in "Application Menu Settings" or at least somewhere in GUI settings.
Comment 9 Nate Graham 2018-11-14 21:36:50 UTC
It *is* in the GUI settings: Right-click on Kickoff > Configure Application Launcher... > Keyboard Shortcuts > Remove Alt-F1 keyboard shortcut.

The one thing we should probably do is document the fact that Alt-F1 is magically turned into the meta key.
Comment 10 Sasha Unspecified 2018-11-15 06:46:54 UTC
(In reply to Nate Graham from comment #9)
> The one thing we should probably do is document the fact that Alt-F1 is
> magically turned into the meta key.

I strongly disagree.
The Meta key (key-up) should have no relation with Alt+F1 key.
For example, I use Alt+F1, but don't use Meta.
(There's setting for this in ~/.config/kwinrc — "[ModifierOnlyShortcuts]\nMeta=", but it's quite counter-intuitive.
I think, it should be a separate checkbox in the settings of "Application Menu" widget.)
Comment 11 Nate Graham 2018-11-15 06:48:52 UTC
I have to imagine that not actually using the meta key itself in the shortcut box is some kind of technical limitation rather than a design decision (because that would have been a bad design decision). I'll look into what the limitation was and see if we can fix that. If we can, then we will. :) But if not, then we can at least document the quick so it's not so inscrutable.
Comment 12 Sasha Unspecified 2018-11-15 07:07:31 UTC
(In reply to Nate Graham from comment #11)

I understand that there might be some technical limitations. (Though I can't imagine what they can be: even if KWin just sends Alt+F1 when the Meta key is pressed (and Alt+F1 is later processed independently by the Menu widget) — I think, it's possible for KWin to send arbitrary other key key-combination (the one that is configured as the primary shortcut in the Menu widget), not hard-coded Alt+F1 or not to generate any if the checkbox is unchecked; as the last resort, I think it's better to have an explicit "Turn Meta key into […] key" in the KWin GUI settings than hard-coded Alt+F1.)
Of course I agree that if nothing else can be done, it should be at least documented.

(P.S.: Now I'll change the title again — just for more readability.)
Comment 13 Sasha Unspecified 2018-11-15 07:13:15 UTC
(In reply to Sasha Unspecified from comment #12)

> send arbitrary other key key-combination
sorry, it should read as "send arbitrary key-combination"

> or not to generate any if the checkbox is unchecked
sorry, it should read as "and not to generate any if the checkbox is unchecked"

Anyway, great thanks.
Comment 14 Misha Shaygu 2020-12-10 06:34:40 UTC
on 5.20.4 still alive bug
Comment 15 skierpage 2021-01-07 23:49:24 UTC
(In reply to Tony from comment #1)
> There is already one, remove ALT+F1 shortcut from the application launcher.
> 
> Although it would be nice to have one on system settings like "Numlock on
> plasma startup".

(In reply to Nate Graham from comment #5)
> When Alt+F1 is configured as the shortcut, KWin automatically binds Meta
> too. Removing the Alt+F1 hotkey will make the Meta key stop opening it.

The problem is this undocumented automagical behavior of enabling the Meta/Windows key if and only if _any_ keyboard shortcut is defined to activate the Application Launcher.

The way to fix the inter-related bugs in behavior and UX is a separate option as others suggested. I mocked up a checkbox, see attachment,
   [x] Meta/Win key also activates Application Launcher applet.
which should appear in both places you can configure the shortcut: 1) right-click launcher icon in Task Manager > Configure Application Launcher > Keyboard Shortcuts ; and 2) System Settings > Shortcuts > Plasma > Activate Application Launcher Widget. BTW the UI must mention the "Win" key (and Apple's keycap name?), since most users have _no idea_ what the "Meta" key is.

Other notes:

You can't use the shortcut UI in either dialog to explicitly assign Meta because the dialog shows Meta+... and waits for another keypress.

In my case Meta and Alt-F1 stopped working (probably because I tried editing the fragile file ~/.config/plasma-org.kde.plasma.desktop-appletsrc to address bug 421498) and I was unable to get Meta working again until I assigned Application Launcher to some other random key combination. I began filing my own bug about this, so this bug's summary is still imperfect.

It may be possible to set Meta as the only shortcut by editing a config file. In the thread https://www.reddit.com/r/kde/comments/5ovjqu/super_key_meta_not_working_anymore/dcmehy8/?context=3 (where the great Martin Graesslin chimes in), someone suggested adding
  global=Meta
to the right containment in ~/.config/plasma-org.kde.plasma.desktop-appletsrc. instead of the common `global=Alt+F1`. Since every time I touch this file things get worse, I didn't try it 😉.
Comment 16 skierpage 2021-01-07 23:50:30 UTC
Created attachment 134650 [details]
UI to explicitly reveal and configure the Meta/Win key activating Application Launcher
Comment 17 skierpage 2021-01-08 00:01:37 UTC
(In reply to skierpage from comment #15)
> The problem is this undocumented automagical behavior...

It is documented in https://userbase.kde.org/Plasma/Tips#Windows.2FMeta_Key :
> If it's not working, make sure your "Start Menu" widget has a global
> shortcut like Alt+F1 set (you can't assign it directly to Meta, but
> it will open with Meta if another shortcut is assigned).
Comment 18 Sasha Unspecified 2021-01-08 16:50:38 UTC
(In reply to skierpage from comment #17)
> It is documented in https://userbase.kde.org/Plasma/Tips#Windows.2FMeta_Key

Even being documented, it's very counterintuitive.
Comment 19 Nate Graham 2022-02-11 22:45:28 UTC
*** Bug 449959 has been marked as a duplicate of this bug. ***
Comment 20 David Edmundson 2022-02-24 00:00:36 UTC
*** Bug 447167 has been marked as a duplicate of this bug. ***
Comment 21 Andrew Shark 2023-07-20 10:26:14 UTC
The title says:
> Do not automatically append the Meta key to the list of shortcuts when Alt+F1 is set
Seems it is not true anymore (if it was ever). For me in Arch Linux in launcher widget's settings, I have no any shortcut assigned. But the Meta key still triggers the launcher (internally, not in UI).

Operating System: Arch Linux 
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Graphics Platform: Wayland

It worth mentioning that the actions of Meta key and the assigned shortcut to the start menu widget are NOT equivalent. The Meta key opens a launcher on the active monitor (monitor with mouse). While assigning a shortcut to the launcher on one of the monitors will trigger only that launcher always, even when mouse is on another screen. And you cannot assign the same shortcut to the launcher on another screen too.

So Meta key has its own behavior, and there was an accurate bur report to allow user to control the behavior of Meta and possibility to assign it to anything else (Bug 449959).

While this bug makes false assumption, I will close it, and reopen that 449959, which was marked as duplicate of current. So we do not need to make any unstandard implementations like in screenshot from comment#16.
Comment 22 Nate Graham 2023-07-25 19:55:03 UTC
Andrew, I'm afraid you're a bit confused.

This bug report is requesting that KWin no longer magically make the Meta key open the Application Launcher anymore once it becomes possible to actually use the Meta key directly as a triggering key in the shortcut chooser widget. This is now possible, so all we need to do is make the actual Meta key open Application Launcher by default and stop KWin from doing its auto-magic stuff.
Comment 23 Nate Graham 2023-07-25 19:55:32 UTC
*** Bug 449959 has been marked as a duplicate of this bug. ***
Comment 24 Andrew Shark 2023-07-25 20:15:22 UTC
Nate, you are saying that assigning modifier only shortcut Meta is now possible in gui? Is not the second part of bug title asks for that?
Comment 25 Nate Graham 2023-07-25 20:28:05 UTC
Yes, that is now possible as of Plasma 5.27.

So what we need to do is:
1. Remove the special modifier only shortcut handling from KWin
2. Set the Meta key as the default shortcut key for the Application Launcher itself
Comment 26 Andrew Shark 2023-07-26 10:29:31 UTC
> Yes, that is now possible as of Plasma 5.27.
At least I cannot do that.

> 1. Remove the special modifier only shortcut handling from KWin
Is that Meta only shortcut currently "eaten" by KWin? And that is a problem why it cannot be currently set for widget on Plasma 5.27.6 for me?

> 2. Set the Meta key as the default shortcut key for the Application Launcher itself
What about the fact that Meta activates an active screen launcher (not an individual widget, see comment21)?

And again, about the title of the bug
> Do not automatically append the Meta key to the list of shortcuts when Alt+F1 is set
As already mentioned in comment21. I now made a Notes widget in a desktop. Assigned Alt + F1 for it. And now by Alt + F1 it is activated. But not by Meta. So the problem that title says about may be treated as solved.
Comment 27 Nate Graham 2023-07-26 19:04:34 UTC
(In reply to Andrew Shark from comment #26)
> > Yes, that is now possible as of Plasma 5.27.
> At least I cannot do that.
Then it broke and that's a bug, because this is supposed to work. I can confirm that it's broken. :/ I've submitted Bug 472679 to track that. Feel free to mark it as CONFIRMED.

> > 1. Remove the special modifier only shortcut handling from KWin
> Is that Meta only shortcut currently "eaten" by KWin? And that is a problem
> why it cannot be currently set for widget on Plasma 5.27.6 for me?
Perhaps? But yes, KWin does eat the Meta key right now.

> > 2. Set the Meta key as the default shortcut key for the Application Launcher itself
> What about the fact that Meta activates an active screen launcher (not an
> individual widget, see comment21)?
This feature would then get lost.

> And again, about the title of the bug
> > Do not automatically append the Meta key to the list of shortcuts when Alt+F1 is set
> As already mentioned in comment21. I now made a Notes widget in a desktop.
> Assigned Alt + F1 for it. And now by Alt + F1 it is activated. But not by
> Meta. So the problem that title says about may be treated as solved.
Sure, we can rename the bug report.
Comment 28 Nate Graham 2023-09-07 19:44:21 UTC
*** Bug 472826 has been marked as a duplicate of this bug. ***
Comment 29 fanzhuyifan 2024-02-20 19:55:53 UTC
Ongoing at https://invent.kde.org/plasma/kwin/-/issues/205
Comment 30 Bug Janitor Service 2024-02-22 02:50:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5268