Bug 426656

Summary: Modification in shortcuts under "Common Actions" only takes effect after re-login
Product: [Applications] systemsettings Reporter: Patrick Silva <bugseforuns>
Component: kcm_keysAssignee: Michael Jansen <kde>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, plasma-bugs
Priority: NOR    
Version: 5.23.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.91

Description Patrick Silva 2020-09-17 21:53:49 UTC
SUMMARY
Reproducible on both Arch Linux (Plasma 5.20 beta) and neon unstable,
on both X11 and Wayland sessions.

STEPS TO REPRODUCE
1. open system settings > shortcuts
2. click on "File" under "Common actions"
3. click on "Move to trash"
4. uncheck default "Del" shortcut (the bug is also reproducible if you skip this step)
5. click on "+ Add custom shortcut" button, assign a shortcut (I assigned alt+del) and clck on "Apply" button
6. open Dolphin and test the just assigned shortcut: it does not work
7. restart Plasma session
8. open Dolphin and test the assigned shortcut again: this time it works

EXPECTED RESULT
assigned shortcut should immediately work, without re-login

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Comment 1 Patrick Silva 2020-09-17 22:02:09 UTC
In fact any modification in "common actions" shortuts takes effect after re-login. If you just uncheck default "del" shortcut and apply the change, it continues to work until re-login.
Comment 2 David Redondo 2020-09-18 12:26:09 UTC
Is it the login process or restarting of applications that did the trick? 
The old kcm claimed that you would need to restart applications 

https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/26/diffs#1dc095b128d342d1fa92901ecb8ba71bc890b355_158_0
Comment 3 Patrick Silva 2020-09-18 13:49:44 UTC
I need to restart Plasma session. Restarting the application (Dolphin in this case) does not help.
Comment 4 Nate Graham 2022-01-10 16:47:11 UTC
Can confirm.
Comment 5 Bug Janitor Service 2022-01-13 13:14:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfig/-/merge_requests/100
Comment 6 Bug Janitor Service 2022-01-13 13:24:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/98
Comment 7 David Redondo 2022-01-24 13:33:20 UTC
Git commit 820dc0a553e50cc4560733d43fca2674a61d43b3 by David Redondo.
Committed on 24/01/2022 at 13:23.
Pushed by davidre into branch 'master'.

Introduce StandardShortcutWatcher to watch for runtime changes

Currently an application needs to be restarted before it can see
any changes made to the standard shortcut configuration. To notify
about changes a new class is introduced that looks for those
changes using KConfigWatcher and also updates the global map.

M  +1    -0    autotests/CMakeLists.txt
A  +63   -0    autotests/kstandardshortcutwatchertest.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.0)]
M  +3    -0    src/gui/CMakeLists.txt
M  +7    -3    src/gui/kstandardshortcut.cpp
A  +20   -0    src/gui/kstandardshortcut_p.h     [License: LGPL(v2.0+)]
A  +46   -0    src/gui/kstandardshortcutwatcher.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.0)]
A  +54   -0    src/gui/kstandardshortcutwatcher.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.0)]

https://invent.kde.org/frameworks/kconfig/commit/820dc0a553e50cc4560733d43fca2674a61d43b3
Comment 8 David Redondo 2022-01-24 13:44:43 UTC
Git commit d3d7f7cd3fa26b6b3a861fde1aca0992f9e80965 by David Redondo.
Committed on 24/01/2022 at 13:33.
Pushed by davidre into branch 'master'.

Change shortcuts of standard actions if standard shortcut changes

Now when standard shortcuts are changed while an application
is running, changes take effect immediately.

M  +18   -0    autotests/kstandardactiontest.cpp
M  +1    -0    autotests/kstandardactiontest.h
M  +30   -3    src/kstandardaction.cpp
M  +1    -1    src/kstandardaction_p.h

https://invent.kde.org/frameworks/kconfigwidgets/commit/d3d7f7cd3fa26b6b3a861fde1aca0992f9e80965