Bug 493482 - Empty notification on shut down with "Show a message in a pop-up" turned on for "Logout" event
Summary: Empty notification on shut down with "Show a message in a pop-up" turned on f...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (other bugs)
Version First Reported In: 6.1.5
Platform: Other Linux
: VLO minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-22 12:53 UTC by Paolo Zamponi
Modified: 2024-09-24 13:05 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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