Bug 519046 - Notification Globals.qml: null-guard bugs cause panel auto-hide to get stuck
Summary: Notification Globals.qml: null-guard bugs cause panel auto-hide to get stuck
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (other bugs)
Version First Reported In: 6.6.4
Platform: CachyOS Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-17 03:28 UTC by patrick@patrickclery.com
Modified: 2026-04-17 16:02 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description patrick@patrickclery.com 2026-04-17 03:28:24 UTC
Three bugs in applets/notifications/global/Globals.qml cause panel auto-hide to get stuck because the notification popup state doesn't clean up properly:

1. Missing null check for plasmoid.containment before accessing .screenGeometry (containment can be null during teardown, causing TypeError)

2. Inverted boolean logic in plasmoidScore(): condition is (!plasmoidItem || plasmoidItem.plasmoid) but should be (!plasmoidItem || !plasmoidItem.plasmoid) — currently returns 0 for VALID plasmoids instead of invalid ones

3. Missing empty array guard in ratePlasmoids() before accessing newPlasmoidItems[0] — causes TypeError when all plasmoid items are filtered out

STEPS TO REPRODUCE
1. Use a KDE Plasma panel with auto-hide enabled (Wayland session)
2. Receive notifications while using the system normally
3. After notifications clear, observe the panel sometimes stays visible / stuck

OBSERVED RESULT
Panel stays visible and will not auto-hide. The following errors appear in the journal:

plasmashell: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:134: TypeError: Cannot read property 'screenGeometry' of null
plasmashell: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:264: TypeError: Cannot read property 'plasmoid' of undefined

Restarting plasmashell temporarily resolves the issue, but it recurs.

EXPECTED RESULT
Panel should auto-hide after notifications are dismissed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (CachyOS)
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.24.0
Qt Version: 6.11.0

ADDITIONAL INFORMATION
Merge request with fix: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6502

Bugs confirmed present on current master branch as well.
Comment 1 Nate Graham 2026-04-17 15:12:16 UTC
Git commit c525bf9ba424d59e9fb353fbadc68131e5e1d35e by Nate Graham, on behalf of Patrick Clery.
Committed on 17/04/2026 at 15:12.
Pushed by ngraham into branch 'master'.

applets/notifications: fix null-guard bugs in Globals.qml

Fix three bugs in the notification applet's Globals.qml that cause panel
auto-hide to get stuck:

1. **Null containment guard** — `plasmoid.containment` can be null during
teardown, but the code accesses `.screenGeometry` without checking. Add
early return with `Qt.rect(0, 0, -1, -1)`.

2. **Inverted boolean fix** — `plasmoidScore()` ha
 `if (!plasmoidItem || plasmoidItem.plasmoid)` which is missing the `!` negation.
This caused the function to return 0 for *valid* plasmoids instead of *invalid* ones.

3. **Empty array guard** — `ratePlasmoids()` accessed `newPlasmoidItems[0]`
without checking array length. When all plasmoid items are filtered out, this
caused a TypeError.

These bugs cause the following errors in the journal, after which the panel
auto-hide gets stuck:

```
plasmashell: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:134: TypeError: Cannot read property 'screenGeometry' of null
plasmashell: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:264: TypeError: Cannot read property 'plasmoid' of undefined
```
FIXED-IN: 6.6.5

M  +9    -1    applets/notifications/global/Globals.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/c525bf9ba424d59e9fb353fbadc68131e5e1d35e
Comment 2 Nate Graham 2026-04-17 16:02:39 UTC
Git commit 6c26f0ef0c6aba603248187a8da89c841a2a965d by Nate Graham.
Committed on 17/04/2026 at 15:13.
Pushed by ngraham into branch 'Plasma/6.6'.

applets/notifications: fix null-guard bugs in Globals.qml

Fix three bugs in the notification applet's Globals.qml that cause panel
auto-hide to get stuck:

1. **Null containment guard** — `plasmoid.containment` can be null during
teardown, but the code accesses `.screenGeometry` without checking. Add
early return with `Qt.rect(0, 0, -1, -1)`.

2. **Inverted boolean fix** — `plasmoidScore()` ha
 `if (!plasmoidItem || plasmoidItem.plasmoid)` which is missing the `!` negation.
This caused the function to return 0 for *valid* plasmoids instead of *invalid* ones.

3. **Empty array guard** — `ratePlasmoids()` accessed `newPlasmoidItems[0]`
without checking array length. When all plasmoid items are filtered out, this
caused a TypeError.

These bugs cause the following errors in the journal, after which the panel
auto-hide gets stuck:

```
plasmashell: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:134: TypeError: Cannot read property 'screenGeometry' of null
plasmashell: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:264: TypeError: Cannot read property 'plasmoid' of undefined
```
FIXED-IN: 6.6.5


(cherry picked from commit c525bf9ba424d59e9fb353fbadc68131e5e1d35e)

a5e8ad61 applets/notifications: fix null-guard bugs in Globals.qml

Co-authored-by: Patrick Clery <patrick@patrickclery.com>

M  +9    -1    applets/notifications/global/Globals.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/6c26f0ef0c6aba603248187a8da89c841a2a965d