Bug 501378

Summary: Window Operations Menu missing keyboard shortcuts and accelerator mnemonics for move virtual desktops
Product: [Plasma] kwin Reporter: kjetil.skjaeveland <kjetil.skjaeveland>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: cwo.kde, kolAflash
Priority: NOR Keywords: regression, usability
Version First Reported In: 6.2.5   
Target Milestone: ---   
Platform: NixOS   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot highlighting the missing keyboard shortcuts compared to older Plasma
proposed kwin-6.3.* patch (Wayland NOT TESTED)
proposed kwin-6.3.* patch (tested Debian-13 X11 and Wayland)

Description kjetil.skjaeveland@gmail.com 2025-03-11 22:57:04 UTC
Created attachment 179320 [details]
Screenshot highlighting the missing keyboard shortcuts compared to older Plasma

SUMMARY
Attached screenshot to highlight the regression, comparing to older Plasma5 versions.

Window Operations Menu is missing keyboard shortcuts for moving windows to specific virtual desktops. 
During the re-design of the menu from radio-buttons to checkboxes & "move to" buttons, the keyboard shortcuts for "Move to Virtual Desktop N" were removed. Looks like it was not intentional. 
This regression breaks keyboard-centric workflows. 

This was previously discussed at https://discuss.kde.org/t/move-to-desktop-context-menu-shortcut/1489/8 , but the discussion missed the key point that the _keyboard_ shortcuts are now missing. The new way of having separate checkboxes and "move to" buttons is good, but the lack of keyboard shortcuts is bad.  

STEPS TO REPRODUCE
1. Press Alt-3 to open Window Operations Menu
2. Press D to open Desktops sub-menu 
3. Press 4 to move window to Virtual Desktop number 4

OBSERVED RESULT
Window is not moved. Window Operations Menu stays open.

EXPECTED RESULT
Window is moved to Virtual Desktop 4 and disappears from current view

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS 24.11
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.8.2
Qt Version: 6.8.2
Comment 1 Bug Janitor Service 2025-03-11 23:33:40 UTC
Thank you for the bug report!

However Plasma 6.2.5 is no longer eligible for support or maintenance from KDE; supported versions are 5.27. (LTS), and 6.3 (non-LTS) or newer. Please upgrade to a supported version as soon as your distribution makes it available to you. Plasma is a fast-moving project, and bugs in one version are often fixed in the next one.

If you need support for Plasma 6.2.5, please contact your distribution, who bears the responsibility of providing support for older releases that are no longer supported by KDE.

If you can reproduce the issue after upgrading to a supported version, feel free to re-open this bug report.
Comment 2 cwo 2025-03-13 11:47:01 UTC
This is still the case on master. I can't say whether there were shortcuts there before, but there aren't any now. The entries also do not have accelerators when Alt is held while (almost) all the others do. This is inconsistent and should be fixed.
Comment 3 kolAflash 2025-05-27 16:04:31 UTC
It's broken in:

Debian-13: kwin-6.3.4 (tested with: X11)
2025-05-26: https://cdimage.debian.org/cdimage/weekly-live-builds/amd64/iso-hybrid/debian-live-testing-amd64-kde.iso

KDE-Neon: kwin-6.3.80 / 6.4-beta (tested with: Wayland)
https://ftp.gwdg.de/pub/linux/kde/extrafiles/neon/images/unstable/20250511-1146/neon-unstable-20250511-1146.iso

I'd appreciate a patch I can apply myself, because this really disrupts my workflow. I'm already compiling kwin myself anyway, because the new tiling is still not usable since around KDE-5.27.
Comment 4 kolAflash 2025-05-27 19:08:32 UTC
Created attachment 181791 [details]
proposed kwin-6.3.* patch (Wayland NOT TESTED)

Found the relevant code position:
https://invent.kde.org/plasma/kwin/-/blob/v5.27.12/src/useractions.cpp?ref_type=tags#L549
https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L590

And I think here the "desktop->name()" misses the replacement pattern:
> desktop->name().replace(QLatin1Char('&'), QStringLiteral("&&"))
https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L546

Another mnemonic is missing here. Should probably be: "Move to &%1"
https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L565

I crafted a kwin-6.3.* patch (see attachment). But it's ONLY TESTED ON X11 with Debian-13. NOT tested with Wayland.
Comment 5 kolAflash 2025-05-27 23:03:27 UTC
Created attachment 181803 [details]
proposed kwin-6.3.* patch (tested Debian-13 X11 and Wayland)
Comment 6 kolAflash 2025-05-28 13:08:19 UTC
There was some confusion in my comment 4.
All the following points are in my kwin-6.3.* patch.

These are the relevant code positions for the bug:
old X11: https://invent.kde.org/plasma/kwin/-/blob/v5.27.12/src/useractions.cpp?ref_type=tags#L557
new X11: https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L488

Wayland seems to never had mnemonics (shortcuts). But it at least had numbers in kwin-5.27.11.
old Wayland: https://invent.kde.org/plasma/kwin/-/blob/v5.27.12/src/useractions.cpp?ref_type=tags#L646
new Wayland: https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L565
And I think here the "desktop->name()" misses the replacement pattern:
> desktop->name().replace(QLatin1Char('&'), QStringLiteral("&&"))

Another mnemonic is missing here. I suggest: "&Move to New Desktop"
https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L590

Everything until here has been tested with my patch on Debian-13 with X11 and Wayland and can probably be merged. Although translation files may need to be updated.

-

Additionally the new Wayland-only "add to desktop" ("add" vs. classical "move") option also has no mnemonic yet.
https://invent.kde.org/plasma/kwin/-/blob/v6.3.90/src/useractions.cpp?ref_type=tags#L546
Included a fix for that in my patch too. But I'm not sure if this part should be merged.
Comment 7 kolAflash 2025-06-17 12:31:58 UTC
Created a pull / merge request:  
https://invent.kde.org/plasma/kwin/-/merge_requests/7774