Bug 493482

Summary: Empty notification on shut down with "Show a message in a pop-up" turned on for "Logout" event
Product: [Plasma] plasmashell Reporter: Paolo Zamponi <feus73>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: kde, natalie_clarius, nate
Priority: VLO    
Version First Reported In: 6.1.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.3.0
Sentry Crash Report:

Description Paolo Zamponi 2024-09-22 12:53:42 UTC
SUMMARY


STEPS TO REPRODUCE
1. Go to Systemsettings -> Notifications -> System Notifications... -> Logout
2. Check "Show a message in a pop-up", then "Apply"
3. Logout, Restart, or Shut down

OBSERVED RESULT
An empty notification (only title, empty body) pops up

EXPECTED RESULT
It should appear a full notification with a message in it

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240919
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-1-default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
It happens also in a just updated Neon Unstable
Comment 1 Nate Graham 2024-09-23 17:20:31 UTC
This is somewhat intentional given the settings you've enabled: you told it to show a popup on shutdown, so that's what it's doing. The fact that the popup lacks text is a minor bug that we can fix; evidently we never expected that anyone would ever want to see a notification popup while logging out so we never gave it text! The intention here was to use the notifications infrastructure to play a sound; showing a popup is not really a thing that makes much sense IMO.
Comment 2 Nate Graham 2024-09-23 22:44:39 UTC
Found the thing that controls this: https://invent.kde.org/frameworks/frameworkintegration/-/blob/master/plasma_workspace.notifyrc?ref_type=heads#L1123

But it has Name= and Comment= keys set to valid text as expected, so it looks like it *should* have the right data.

But then here's the code that actually shows the notification: https://invent.kde.org/plasma/plasma-workspace/-/blob/master/ksmserver/logout.cpp?ref_type=heads#L370

Oops! We pass an empty string to the KNotification::event() constructor, so the text set in the notifyrc file is ignored. We could simply re-state the text there, but it would be better to use the text in the notifyrc file. I'm not sure how to do that; will need to look into it.
Comment 3 Nate Graham 2024-09-24 11:33:31 UTC
Apparently it's intended that we need to duplicate the text in the code.
Comment 4 Nate Graham 2024-09-24 13:05:57 UTC
Git commit 2350ec270724b15d20303cfd66597a40fab13f22 by Nate Graham.
Committed on 24/09/2024 at 13:04.
Pushed by ngraham into branch 'master'.

ksmserver: Add text for the "Session is ending" event

If the user opts to turn on the notification popup for this event, they
expect it to show some text. Do so.
FIXED-IN: 6.3.0

M  +4    -1    ksmserver/logout.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/2350ec270724b15d20303cfd66597a40fab13f22