Bug 489032

Summary: Hotkeys stop working on X11 after switching X11 <-> Wayland.
Product: [Frameworks and Libraries] frameworks-kglobalaccel Reporter: Kirill Zhumarin <kirill.zhumarin>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: major    
Priority: NOR    
Version First Reported In: 6.1.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Configs examples.

Description Kirill Zhumarin 2024-06-23 10:08:36 UTC
Created attachment 170851 [details]
Configs examples.

SUMMARY
Hotkeys stop working on X11 after switching X11 <-> Wayland.

STEPS TO REPRODUCE
1. Switch from X11 to Wayland
2. Switch from Wayland to X11

OBSERVED RESULT
Some global shortcuts (for e.g. Ctrl+Alt+T) stop working. Any hotkeys in Java with Swing also stop working.

EXPECTED RESULT
Working hotkeys/global shortcuts.

SOFTWARE/OS VERSIONS
KDE neon
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Seems to be:
1. X11 and Wayland have inconsistent settings in kglobalaccel.
2. "Defaults" button (or just removing kglobalshortcutsrc) doesn't fix the issue.
3. Only one way to fix is reset entire settings. Only after this procedure can we get working kglobalshortcutsrc for X11.

This is how I fix it:
```
# Temporary reset configs to default settings
mv ~/.config ~/.config-bad
sudo systemctl restart sddm

# Copy the right config
cp ~/.config/kglobalshortcutsrc ~/.config-bad/kglobalshortcutsrc

# Restore old configs
rm -rf ~/.config
mv ~/.config-bad ~/.config
sudo systemctl restart sddm
```

See in attachments:
config.diff - difference between good and bad configs.
kglobalshortcutsrc-good - this config was generated after removing .confg (good)
kglobalshortcutsrc-bad - this config was generated after removing only ~/.config/kglobalshortcutsrc (bad)
Comment 1 Kirill Zhumarin 2024-06-23 10:38:10 UTC
The reason turned out to be different.