Bug 465488

Summary: No app name in the Battery and Brightness inhibition notification
Product: [Plasma] plasmashell Reporter: Cimbali <me>
Component: Power and Battery widgetAssignee: Cimbali <me>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, kde, me, nate
Priority: NOR    
Version First Reported In: 5.26.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:
Attachments: Screenshot of incorrect display

Description Cimbali 2023-02-08 18:57:35 UTC
Created attachment 156083 [details]
Screenshot of incorrect display

SUMMARY

When the Screensaver is inhibited without app name, no fall back is provided by the batterymonitor applet.

STEPS TO REPRODUCE
1. Call `org.freedesktop.impl.portal.Inhibit` on the DBus with an empty string for name

Note that this happens when e.g. xdg-desktop-portal fails to lookup the application id of an application that is calling `org.freedesktop.portal.Inhibit`. This should happen less often after https://github.com/flatpak/xdg-desktop-portal/issues/963 is fixed but may still happen.

OBSERVED RESULT

The applet shows the notification “ is currently blocking sleep and screen locking (reason)“ (see attached screenshot).

EXPECTED RESULT

The applet should replace the missing application name in the notification, e.g. with “An application” which would display the following notification message:
“An application is currently blocking sleep and screen locking (reason)“


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: OpenSUSE Tumbleweed (rolling release ; current version id on my system is 20230130)
(available in About System)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

I’
Comment 1 Nate Graham 2023-02-12 17:01:02 UTC
Will be fixed by https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2597.
Comment 2 Nate Graham 2023-02-16 17:37:44 UTC
Git commit dfcade1ce446e3684a7d4a2033305d36ed0d09bf by Nate Graham, on behalf of Cimbali.
Committed on 16/02/2023 at 17:37.
Pushed by ngraham into branch 'master'.

applets/batterymonitor: fix display for missing application name

Sometimes the application name is missing, and this commit adds placeholder text
to handle that case.
FIXED-IN: 6.0

M  +23   -7    applets/batterymonitor/package/contents/ui/PowerManagementItem.qml

https://invent.kde.org/plasma/plasma-workspace/commit/dfcade1ce446e3684a7d4a2033305d36ed0d09bf