Bug 471370 - Reassigning a shortcut does not get applied
Summary: Reassigning a shortcut does not get applied
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keys (other bugs)
Version First Reported In: 5.27.6
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 482068 501869 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-06-23 08:49 UTC by nicos
Modified: 2026-03-20 23:05 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicos 2023-06-23 08:49:53 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. open system settings, select the "shortcuts" section, then the "kwin" section.
2. select any action, e.g. "Switch one desktop down"
3. Click on "Add custom shortcut"
4. type keys Meta+e. A pop up is displayed saying "Shorcut Meta+E si already assigned to action 'Dolphin' of Dolphin. Do you want to reassign it?"
5. Click on Yes
6. In the lower right corner of system settings, click on "Apply".

OBSERVED RESULT
typing Meta+e does nothing, not even opening dolphin.

EXPECTED RESULT
When I type Meta+e, plasma switches one desktop down.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 6.3.7-1-default/5.27.6
(available in About System)
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
 - If between step 5 and 6 I uncheck the Meta+Ctrl+Down default setting, and check it back, then everything works as I expect.
 - If I click on another section of the settings panel (e.g. "About this system") and come back to Shortcuts -> KWin, the Meta+E setting I put on "switch one desktop down" has disappeared.
 - If after step 6 I select the Dolphin section in the shortcuts, click on "Add custom shortcut", type Meta+e, approve the reassign, click on Apply, and type Meta+E, then Dolphin does show up.
 - I observed the same behavior both on my personal Fedora machine and on my work tumbleweed machine.
 - If I assign another shorcut that does not conflict with another shorcut, then it works as expected.
Comment 1 Nate Graham 2023-09-14 21:24:22 UTC
Can reproduce in Plasma 6 as well.
Comment 2 Nicolas Fella 2024-03-11 22:01:21 UTC
*** Bug 482479 has been marked as a duplicate of this bug. ***
Comment 3 Nicolas Fella 2024-03-11 22:01:30 UTC
*** Bug 482068 has been marked as a duplicate of this bug. ***
Comment 4 Eric Renfro 2024-10-24 03:28:56 UTC
I can reproduce this exact behavior on Fedora 40 with Plasma 6.2.1 as well. It also seems to happen similar when importing shortcuts with overriding settings, it doesn't do it there either.
Comment 5 John Kizer 2025-04-08 13:56:08 UTC
*** Bug 501869 has been marked as a duplicate of this bug. ***
Comment 6 Bug Janitor Service 2026-03-18 10:50:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/3613
Comment 7 David Redondo 2026-03-20 09:25:23 UTC
Git commit 8f3f2e2719c0459f48c65b1960368a2ab884b14a by David Redondo, on behalf of Dávid Bácskay-Nagy.
Committed on 20/03/2026 at 09:25.
Pushed by davidre into branch 'master'.

kcm/keys: prevent shortcut conflicts during save (BUG: 471370)

Fixes a bug where reassigning or swapping shortcuts could lead to temporary conflicts due to single-pass updates.

Use a two-phase approach: first remove obsolete shortcuts, then apply new ones, ensuring conflict-free updates.

To test: assign two actions different shortcuts, then swap them and save.

M  +46   -22   kcms/keys/globalaccelmodel.cpp
M  +1    -0    kcms/keys/globalaccelmodel.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/8f3f2e2719c0459f48c65b1960368a2ab884b14a
Comment 8 David Redondo 2026-03-20 10:17:06 UTC
Git commit d5683ac64602286008d334e9d733c7efcaed7000 by David Redondo.
Committed on 20/03/2026 at 09:34.
Pushed by davidre into branch 'Plasma/6.6'.

kcm/keys: prevent shortcut conflicts during save (BUG: 471370)

Fixes a bug where reassigning or swapping shortcuts could lead to temporary conflicts due to single-pass updates.

Use a two-phase approach: first remove obsolete shortcuts, then apply new ones, ensuring conflict-free updates.

To test: assign two actions different shortcuts, then swap them and save.


(cherry picked from commit 8f3f2e2719c0459f48c65b1960368a2ab884b14a)

fa296b49 kcm/keys: prevent shortcut conflicts during save
675518ef kcm/keys: simplify two-phase shortcut saving logic
88c33900 kcm/keys: update initialShortcuts incrementally in two-phase save
e87c84b5 kcm/keys: Remove unnecessary const_as

Co-authored-by: Dávid Bácskay-Nagy <daviddani84@gmail.com>

M  +46   -22   kcms/keys/globalaccelmodel.cpp
M  +1    -0    kcms/keys/globalaccelmodel.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/d5683ac64602286008d334e9d733c7efcaed7000