Bug 484884

Summary: Overriden default shortcuts stop working after relogin
Product: [Frameworks and Libraries] frameworks-kglobalaccel Reporter: Jan B. <bugs.kde>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: chermnykh2001, kinneyanick
Priority: NOR    
Version: 6.0.0   
Target Milestone: ---   
Platform: NixOS   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: my current kglobalshortcutsrc config file

Description Jan B. 2024-04-01 18:58:49 UTC
Created attachment 168034 [details]
my current kglobalshortcutsrc config file

SUMMARY
When overriding default shortcuts in other options or applications it only applies to the current session. When login out und in again (and parsing kglobalshortcutsrc) these shortcuts stop working do nothing. Not even their default binding. Every other shortcut (which did not trigger a reassign warning) works normally.

STEPS TO REPRODUCE
1. Set "Meta+R" or "Meta+Shift+S" for any other application or option than default and Apply (Shortcuts in System Settings)
2. Logout and Login (alternative reboot)
3. Try again one of the shortcuts set in step 1

OBSERVED RESULT
Shortcut has no function at all

EXPECTED RESULT
Shortcuts work are persistent and consistent over reboots and relogins.

SOFTWARE/OS VERSIONS
Operating System: NixOS 24.05
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3
Kernel Version: 6.8.2 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
I recognized that are changes between Plasma5 and Plasma6 in how custom application shortcuts are saved in kglobalshortcutsrc. 

Also I get these Messages in the journal on login. They are part plasma-kwin_wayland.service unit:
Apr 01 11:41:59 cookieclicker kwin_wayland[23270]: kf.globalaccel.kglobalacceld: Shortcut found twice in kglobalshortcutsrc. QKeySequence("Meta+R")
Apr 01 11:41:59 cookieclicker kwin_wayland[23270]: kf.globalaccel.kglobalacceld: Shortcut found twice in kglobalshortcutsrc. QKeySequence("Meta+Shift+S")

Also testing some other shortcuts like "Meta+E" and they show the same broken behaviour. Surprisingly when applying "Meta+." to something else it is mentioned as a duplicate in the journal, but the Emoji Selector is still opened.
Comment 1 Dmitrii Chermnykh 2024-04-18 18:26:36 UTC
It's probably a NixOS packaging issue
Comment 2 Dmitrii Chermnykh 2024-04-18 18:58:45 UTC
I've reported it as https://github.com/NixOS/nixpkgs/issues/305119
Comment 3 Nicholas Kinney 2024-04-20 17:32:32 UTC
(In reply to Dmitrii Chermnykh from comment #1)
> It's probably a NixOS packaging issue

I'm experiencing the same issue on the latest stable arch release
Comment 4 Dmitrii Chermnykh 2024-04-20 17:55:29 UTC
For me the shortcuts worked fine on plasma 6.0.4 on Arch; but got broken after I switched to NixOS (also plasma 6.0.4)
Comment 5 Dmitrii Chermnykh 2024-04-20 19:20:33 UTC
(In reply to Nicholas Kinney from comment #3)
> (In reply to Dmitrii Chermnykh from comment #1)
> > It's probably a NixOS packaging issue
> 
> I'm experiencing the same issue on the latest stable arch release

Does the problem reproduce for you if you wipe ~/.cache directory?
Comment 6 Nicholas Kinney 2024-04-21 02:28:14 UTC
(In reply to Dmitrii Chermnykh from comment #5)
> (In reply to Nicholas Kinney from comment #3)
> > (In reply to Dmitrii Chermnykh from comment #1)
> > > It's probably a NixOS packaging issue
> > 
> > I'm experiencing the same issue on the latest stable arch release
> 
> Does the problem reproduce for you if you wipe ~/.cache directory?

This did solve the problem
Comment 7 Nicholas Kinney 2024-04-21 02:37:34 UTC
(In reply to Nicholas Kinney from comment #6)
> (In reply to Dmitrii Chermnykh from comment #5)
> > (In reply to Nicholas Kinney from comment #3)
> > > (In reply to Dmitrii Chermnykh from comment #1)
> > > > It's probably a NixOS packaging issue
> > > 
> > > I'm experiencing the same issue on the latest stable arch release
> > 
> > Does the problem reproduce for you if you wipe ~/.cache directory?
> 
> This did solve the problem

Actually, some of the shortcuts are still broken, it just changed which ones are affected. For example, I have a shortcut to capture a region of the screen with meta+shift+s, which appears to have a default binding in spectacle and is being overwritten. My override for the terminal shortcut ctrl+shift+t does work with terminator instead of konsole now after removing the .cache entries.
Comment 8 Dmitrii Chermnykh 2024-04-21 09:49:47 UTC
On NixOS i've disabled the services that wipes `~/.cache/ksycoca6_*` on each re-login (which was intended as a workaround for another nix packaging problem) which resolved the issue for me
Comment 9 Dmitrii Chermnykh 2024-04-22 09:34:26 UTC

*** This bug has been marked as a duplicate of bug 484682 ***