Bug 495475

Summary: Shortcuts using accented characters are not saved into the config file correctly, and get removed after a reboot
Product: [Frameworks and Libraries] frameworks-kglobalaccel Reporter: jonasdoering1
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: CONFIRMED ---    
Severity: normal CC: fanzhuyifan, kde, kdedev, nate
Priority: NOR    
Version: 6.7.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description jonasdoering1 2024-10-28 11:10:58 UTC
SUMMARY
Custom Hotkeys are lost after a restart when they contain a accent key.


STEPS TO REPRODUCE
1. Open the TaskSwitcher settings
2. Set a new hotkey for "Current Application": "Forward" with an accent. For me, it was ALT+^ b/c on the German keyboard layout that's the key above the tab.
3. See that the new set hotkey isn't displayed properly but with a "?"/invalid character symbol
4. See that the new hotkey is working nevertheless.
5. Restart. The hotkey won't work anymore.

I did some testing and it seem's connected to accents (or keys which require an additional input), So for example ` suffers from the same issue.

OBSERVED RESULT
After a restart, the custom hotkey is gone.


EXPECTED RESULT
After a restart, the custom hotkey should still be set.


SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-10-28 14:16:20 UTC
After you set the desired shortcut, can you open the ~/.config/kglobalshortcutsrc file, fine the line with "Walk Through Windows" in it, and paste the whole line here? Perhaps the accented character is getting saved to the config file incorrectly, and then gets marked as invalid and removed later.
Comment 2 jonasdoering1 2024-10-28 14:50:16 UTC
(In reply to Nate Graham from comment #1)
> After you set the desired shortcut, can you open the
> ~/.config/kglobalshortcutsrc file, fine the line with "Walk Through Windows"
> in it, and paste the whole line here? Perhaps the accented character is
> getting saved to the config file incorrectly, and then gets marked as
> invalid and removed later.

Hey, thank you for the quick response! I think my problem is with "Walk Through Windows of Current Application", but you're right, the character there looks screwed:

> Walk Through Windows=Alt+Tab,Alt+Tab,Walk Through Windows
> Walk Through Windows (Reverse)=Alt+Shift+Tab,Alt+Shift+Tab,Walk Through Windows (Reverse)
> Walk Through Windows Alternative=,,Walk Through Windows Alternative
> Walk Through Windows Alternative (Reverse)=,,Walk Through Windows Alternative (Reverse)
> Walk Through Windows of Current Application=Alt+ោ?,Alt+`,Walk Through Windows of Current Application
> Walk Through Windows of Current Application (Reverse)=,Alt+~,Walk Through Windows of Current Application (Reverse)
> Walk Through Windows of Current Application Alternative=,,Walk Through Windows of Current Application Alternative
> Walk Through Windows of Current Application Alternative (Reverse)=,,Walk Through Windows of Current Application Alternative (Reverse)

So the faulty line is probably:
> Alt+ោ?,Alt+`
Idk where Alt+` is coming from, maybe from previous experiment
Comment 3 jonasdoering1 2024-10-28 15:02:01 UTC
Looks like I cannot edit my post: after restarting, the line in question becomes "Walk Through Windows of Current Application=,Alt+`,Walk Through Windows of Current Application". So I figure Alt+` is some default value, and you're probably having the right hunch here. That said, changing the line to "Walk Through Windows of Current Application=Alt+^,Alt+`,Walk Through Windows of Current Application" , manually achieved nothing - it remains, but doesn't allow me to toggle through the windows.