https://bugs.kde.org/show_bug.cgi?id=522563
Bug ID: 522563
Summary: Hotkey binds of custom context menu item dissapears
Classification: Applications
Product: dolphin
Version First 26.04.2
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
Created attachment 193977
--> https://bugs.kde.org/attachment.cgi?id=193977&action=edit
Hotkey binds of custom context menu item dissapears
SUMMARY
A keyboard shortcut assigned to a service menu action (Configure Keyboard
Shortcuts -> Context Menu Actions) stops triggering after Dolphin reloads its
file item actions, for example after enabling or disabling a service menu, or
after a background update rewrites kservicemenurc. The shortcut is not removed
from disk; it is still present in dolphinui.rc. Only the in-memory binding is
lost, so the key does nothing until Dolphin is restarted. The context menu
entry itself keeps working the whole time.
STEPS TO REPRODUCE
1. Have a file-based service menu installed (any .desktop in
~/.local/share/kio/servicemenus/ with a [Desktop Action]).
2. In Dolphin, open Configure Keyboard Shortcuts, and under "Context Menu
Actions" assign a shortcut (e.g. Ctrl+Shift+E) to the service menu action.
Confirm it fires, and that it was saved to
~/.local/share/kxmlgui5/dolphin/dolphinui.rc as
<Action name="servicemenu_<file>.desktop::<key>" shortcut="Ctrl+Shift+E"/>.
3. Open Configure Dolphin -> Context Menu, toggle any service menu entry on or
off, and click Apply. (This rewrites kservicemenurc and triggers a reload.)
4. Press the shortcut.
OBSERVED RESULT
The shortcut no longer triggers the action. The context menu entry is still
present. The <Action ... shortcut="..."/> line is still in dolphinui.rc and the
file's modification time is unchanged, so nothing was written; only the live
QAction lost its accelerator. The shortcut also now shows as unset in the
Configure Keyboard Shortcuts dialog. Restarting Dolphin restores the shortcut.
EXPECTED RESULT
The shortcut keeps working after the reload, since it is still configured and
still saved in dolphinui.rc.
SOFTWARE/OS VERSIONS
Operating System: Arch Linux
Dolphin Version: 26.04.2
KDE Plasma Version: 6.7.1
ADDITIONAL INFORMATION
This is a gap in the service menu shortcut feature added in commit db49ac4e1
("Add keyboard shortcut support for service menu actions"). Reproduced live on
26.04.2; by code inspection the relevant code is unchanged in 26.04.3, the
release/26.04 branch, and master, so it affects all of them.
Cause: DolphinMainWindow::setupFileItemActions() calls
ServiceMenuShortcutManager::refresh(), which recreates the service menu
QActions
from scratch with no shortcut. The saved shortcut (an ActionProperties entry in
dolphinui.rc) is applied only by setupGUI(), which runs once at startup right
after the first refresh(). setupFileItemActions() is also called later without
a
following setupGUI(): from the kservicemenurc KConfigWatcher connected in the
DolphinMainWindow constructor, and from DolphinMainWindow::refreshViews(). On
those reload paths the rebuilt action is left with no accelerator while the
shortcut is still saved on disk, so the key silently stops firing until the
next
restart re-runs the startup path.
Fix: re-apply the saved ActionProperties to the recreated actions after each
refresh(), reusing the same lookup that
ServiceMenuShortcutManager::cleanupStaleShortcuts() already performs. Patch
attached.
I've tested the attachment patch locally and recompiled it, then when launching
the new bin, now my hotkeys remain bound even after doing the steps described
above.
--
You are receiving this mail because:
You are watching all bug changes.