Bug 511924 - Custom Global Shortcut not activated on Wayland startup (config is ignored)
Summary: Custom Global Shortcut not activated on Wayland startup (config is ignored)
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: 6.5.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-10 16:43 UTC by zajdlik.lukas
Modified: 2025-11-10 18:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
attachment-2207837-0.html (1.10 KB, text/html)
2025-11-10 18:01 UTC, zajdlik.lukas
Details
attachment-2216938-0.html (565 bytes, text/html)
2025-11-10 18:30 UTC, zajdlik.lukas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zajdlik.lukas 2025-11-10 16:43:49 UTC
SUMMARY

Custom Global Shortcut not activated on Wayland startup (config is ignored)

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org
If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Please remove this comment after reading and before submitting - thanks!
***

### Environment Details

* **Operating System:** **Arch Linux**
* **KDE Plasma Version:** **6.5.2**
* **KDE Frameworks Version:** **6.5.x** (Corresponding to Plasma 6.5.2 release)
* **Qt Version:** **6.x** (Built against Qt 6)
* **Windowing System:** **Wayland**

### Steps to Reproduce

1.  Create a custom shell script (e.g., `~/config/scripts/toggle_audio.sh`).
2.  Create a corresponding KDE Service Entry file: `~/.local/share/applications/toggle_audio.sh.desktop`.
3.  Manually ensure the required shortcut is written to the configuration file:
    ```ini
    [services][net.local.toggle_audio.sh.desktop]
    _launch=Meta+Z
    ```
4.  Restart the KDE Plasma session (Logout/Login or full system reboot).
5.  Attempt to trigger the shortcut **Meta+Z**.

### Observed Result

1.  The `Meta+Z` shortcut **does not work** upon session startup.
2.  The custom shortcut **is not visible** in the System Settings > Shortcuts GUI, despite the correct entries being present in `kglobalshortcutsrc`.

### Expected Result

The shortcut `Meta+Z` should be automatically loaded, indexed, and activated by `kglobalacceld` and KWin upon session startup, as the configuration file (`kglobalshortcutsrc`) is identical to the working configuration.

### Crucial Diagnostic Findings (The Silent Failure)

The failure is isolated to the D-Bus/Internal Caching layer of KDE, as proven by the following:

1.  **GUI Fix:** If the user opens System Settings > Shortcuts, finds the custom shortcut (or creates any new one), and clicks **Apply/Save**, the `Meta+Z` shortcut **immediately becomes active and functional**. This single GUI action forces the correct indexation.
2.  **Configuration Identity:** The content of the `kglobalshortcutsrc` file *after* a manual GUI save is **byte-for-byte identical** to the content written by the automation script.
3.  **D-Bus Reload Attempt Failure:** Standard D-Bus methods for forcing a configuration reload fail to activate the shortcut after startup, even though some commands execute without error:
    * `qdbus org.kde.KWin /KWin org.kde.KWin.reconfigureShortcuts` (Failed: `UnknownMethod`)
    * `qdbus org.kde.KWin /KWin org.kde.KWin.reloadConfig` (Failed: `UnknownMethod`)
    * `qdbus org.kde.KWin /KWin org.kde.KWin.reconfigure` (Executed successfully, but did **not** activate the shortcut).
    * `qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "net.local.toggle_audio.sh.desktop._launch"` (Executed successfully, but did **not** trigger the action).

### Proposed Cause

KDE Plasma is failing to properly index and link the custom Service Entry (`.desktop` file) and its corresponding entry in `kglobalshortcutsrc` during the initial passive session load. Activation only occurs when the GUI triggers an explicit, "live" D-Bus signal that bypasses the broken initialization/caching routine.

### Suggested Mitigation

Developers should investigate why the D-Bus services responsible for global shortcut configuration (`kglobalaccel`/`KWin`) ignore or fail to index new Service Entries written to the filesystem without an accompanying explicit user interaction in the System Settings GUI.
Comment 1 Nicolas Fella 2025-11-10 17:09:34 UTC
Please do not use AI to write bugreports
Comment 2 zajdlik.lukas 2025-11-10 18:01:50 UTC
Created attachment 186675 [details]
attachment-2207837-0.html

Please explain to me why I can't use AI-generated bug reports

Dne po 10. 11. 2025 18:32 uživatel TraceyC <bugzilla_noreply@kde.org>
napsal:

> https://bugs.kde.org/show_bug.cgi?id=511924
>
> TraceyC <kdedev@tlcnet.info> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |kdedev@tlcnet.info
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Nicolas Fella 2025-11-10 18:14:21 UTC
Because your report 
- is an eyesore to look at because of excessive use of Markdown syntax, which is not supported on bugzilla
- is containing factually wrong information while missing other relevant information (e.g. the Qt and KDE Frameworks versions are wrong/missing)
- I cannot trust that any information given isn't just made up by AI, and double checking everything written is a waste of our time
Comment 4 zajdlik.lukas 2025-11-10 18:30:58 UTC
Created attachment 186676 [details]
attachment-2216938-0.html

I acknowledge,

1. I apologize for the negative experience with the unsightly form of the
bug report

2. This is not a problem of AI, but rather my inexperience in creating
reports, if important information is not included now, I would not include
it, even if I wrote it personally.

3. Just as you cannot trust me personally.

If the report is not beneficial to KDE, please delete it, or suggest what
status I should change it to. Thanks for your time and experience for me.

Translated using Google translator.