https://bugs.kde.org/show_bug.cgi?id=511981
Bug ID: 511981
Summary: Fix System Tray widget global shortcuts not working
Classification: Plasma
Product: plasmashell
Version First 6.0.0
Reported In:
Platform: Ubuntu
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: System Tray widget
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: 1.0
Created attachment 186718
--> https://bugs.kde.org/attachment.cgi?id=186718&action=edit
Patch for system tray
# Fix System Tray widget global shortcuts not working
## Summary
This patch fixes a bug where global keyboard shortcuts assigned to the System
Tray widget are registered in kglobalaccel but do not activate the widget. The
root cause is that System Tray disconnects the default `activated` signal
handler but never connects its own.
**This is a regression introduced in Plasma 6.0 during the nested containment
refactoring and remains unfixed in master as of November 2025.**
## Bug Description
**Affected versions:** Plasma 6.0 - 6.5.2, master
**Regression from:** Plasma 5.21+ (where it worked correctly)
**Severity:** Medium - Feature regression from Plasma 5
**Git history verified:** Bug NOT fixed in any version 6.0+
When users assign a global shortcut to the System Tray widget through the GUI
(Configure System Tray → Keyboard Shortcuts):
1. The shortcut is saved in configuration
2. The shortcut is registered in kglobalaccel
3. Pressing the shortcut sends the `activated` signal
4. **Nothing happens** - the System Tray does not expand
This works correctly for other widgets like Analog Clock, which use the default
`PlasmoidItem` handler.
## Root Cause
In `plasma-workspace/applets/systemtray/systemtray.cpp` lines 63-67, the System
Tray explicitly disconnects the `activated` signal from child applets:
```cpp
// we don't want to automatically propagate the activated signal from the
Applet to the Containment
// even if SystemTray is of type Containment, it is de facto Applet and should
act like one
connect(this, &Containment::appletAdded, this, [this](Plasma::Applet *applet) {
disconnect(applet, &Applet::activated, this, &Applet::activated);
});
```
However, **no handler is connected for the System Tray's own `activated`
signal**, unlike other widgets which inherit the default behavior from
`PlasmoidItem`
(plasma-framework/src/plasmaquick/plasmoid/plasmoiditem.cpp:99-105).
## Verification
```bash
# Shortcut IS registered in kglobalaccel
$ qdbus6 org.kde.kglobalaccel /component/plasmashell \
org.kde.kglobalaccel.Component.allShortcutInfos | grep "activate widget"
# Shows: [Argument: ai {234881108}] ✓
# Signal IS sent when shortcut is pressed
$ qdbus6 org.kde.kglobalaccel /component/plasmashell \
org.kde.kglobalaccel.Component.invokeShortcut "activate widget 8"
# Executes without error ✓
# But System Tray does NOT respond ✗
```
## Solution
Add a QML handler for the `activated` signal in the System Tray's main.qml to
toggle the expanded state.
## Changes
**File:** `applets/systemtray/package/contents/ui/main.qml`
After the `Component.onCompleted` block (line 46), add:
```qml
// BUGFIX: Handle activated signal to toggle expansion (for global shortcuts)
Connections {
target: Plasmoid
function onActivated() { systemTrayState.expanded =
!systemTrayState.expanded; }
}
```
## Testing
1. Right-click System Tray → Configure System Tray
2. Go to Keyboard Shortcuts tab
3. Assign a shortcut (e.g., Ctrl+Alt+Shift+T)
4. Click Apply
5. Press the assigned shortcut
6. **Expected:** System Tray popup appears/disappears
7. **Before patch:** Nothing happens
8. **After patch:** System Tray toggles correctly ✓
## Related Code
- **plasma-framework/src/plasmaquick/plasmoid/plasmoiditem.cpp:99-105** -
Default activated handler that works for other widgets
- **plasma-workspace/shell/kconf_update/plasma6.0-remove-old-shortcuts.cpp** -
Migration script that mentions widget shortcuts should be handled explicitly in
Plasma 6
## Related Commits
- **0411253613** (Oct 2020, Plasma 5.21) - Original fix that worked in Plasma 5
by adding `setGlobalShortcut()` in `restoreContents()` and the `disconnect()`
line
- **46ada24fd8** (Mar 2024, Plasma 6.0) - Refactored to nested containment,
regression likely introduced here
- **9c872a5428** (Jun 2024, Plasma 6.2) - Fixed shortcuts for child applets
**inside** System Tray, but not for System Tray itself
- **cb73a963c0** (Feb 2025, master) - Focus improvements, unrelated to
shortcuts
**Analysis:** The bug has been present since Plasma 6.0 and remains unfixed in
master (verified Nov 2025).
## Notes
- This regression was introduced in Plasma 6.0 when the automatic signal
propagation was removed
- The comment in systemtray.cpp indicates this was intentional, but no
replacement handler was added
- Other containment-based widgets may have the same issue and need similar
fixes
- This does not affect widgets that use the standard `PlasmoidItem` behavior
- This bug can also occur in other widgets, such as Media Frame.
## Checklist
- [x] Patch applies cleanly to v6.4.5
- [x] Tested on Kubuntu 25.10 with Plasma 6.4.5
- [x] No compilation warnings introduced
- [x] Feature works as expected after patch
- [x] Does not affect other System Tray functionality
- [x] Follows existing code style (QML Connections pattern)
---
**Patch file:** `systemtray-activation-fix.patch`
**Reported by:** Mikhail Pavlovich Sidorenko via Cursor
**Tested on:** KDE Plasma 6.4.5, KDE Frameworks 6.17.0, Qt 6.9.2
**Date:** 2025-11-12
--
You are receiving this mail because:
You are watching all bug changes.