Bug 362924 - Red battery icon shown for desktop pc
Summary: Red battery icon shown for desktop pc
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Battery Monitor (show other bugs)
Version: 5.6.3
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-11 06:43 UTC by denk
Modified: 2016-05-12 15:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Output of upower -d (1.70 KB, text/plain)
2016-05-11 06:45 UTC, denk
Details
Battery icon in the panel (2.01 KB, image/png)
2016-05-11 07:10 UTC, denk
Details
Tooltip of the battery icon (10.03 KB, image/png)
2016-05-11 07:10 UTC, denk
Details
Popup of the battery icon (31.67 KB, image/png)
2016-05-11 07:12 UTC, denk
Details
Output in battery section of Plasmaengineexplorer (62.80 KB, image/png)
2016-05-11 11:40 UTC, denk
Details
Fix tooltip and icon (1.83 KB, patch)
2016-05-11 12:00 UTC, Kai Uwe Broulik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description denk 2016-05-11 06:43:19 UTC
On my desktop pc the battery icon is always red with a ac plug in it. The tooltip always says 0% charging. If I click on it, the popup shows the two batteries of my mouse and keyboard correctly.

Reproducible: Always

Steps to Reproduce:
1. Look at the battery icon.

Actual Results:  
Battery icon is always red and says 0% charging.

Expected Results:  
Battery icon should recognize that the system is a desktop pc without battery.
Comment 1 denk 2016-05-11 06:45:05 UTC
Created attachment 98890 [details]
Output of upower -d
Comment 2 Kai Uwe Broulik 2016-05-11 06:53:52 UTC
The icon is hidden in the popup, right? If so then it behaves as intended.
Comment 3 denk 2016-05-11 07:09:43 UTC
Actually not, the icon is always visible in the panel (see screenshots). If this is the intended functionality, I see two problems:
1. Displaying always a red icon is misleading and suggests to the user, that there could be a problem which should be taken care of.
2. The tooltip saying "0% Wird geladen" (this is german, in english "0% charging") is misleading, too.
Would it be possible to think about the intended behaviour again and find maybe some other way of visualization?
Comment 4 denk 2016-05-11 07:10:09 UTC
Created attachment 98891 [details]
Battery icon in the panel
Comment 5 denk 2016-05-11 07:10:29 UTC
Created attachment 98892 [details]
Tooltip of the battery icon
Comment 6 denk 2016-05-11 07:12:26 UTC
Created attachment 98893 [details]
Popup of the battery icon
Comment 7 Kai Uwe Broulik 2016-05-11 08:20:06 UTC
You're right, the battery monitor should hide in the popup and the tooltip should reflect the missing battery.

Can you have a look at the "powermanagement" dataengine using plasmaengineexplorer (part of plasma-sdk)? Look in the "Battery" section (not Battery0) and see what it says for "Has Cumulative". It has two properties, one "Has Battery" which is whether there is any battery at all (your mouse/keyboard), and "Has Cumulative" whether there is a battery actually powering the device.

Okay, I found the issue for the tooltip: The thing just checks if (batteries.count == 0) instead of the "Has Cumulative" property and then it says "x% charging". The mystery is now why the applet did not hide itself in the popup automatically, according to your upower output both devices correctly report "power supply: no".
Comment 8 denk 2016-05-11 11:40:22 UTC
Please see attached screenshot for the output of Plasmaengineexplorer.

I think that the reason for the always shown icon is my configuration, so maybe no mystery here. According to the settings in System Tray Settings the respective entry for powermanagement is set to Shown (which is what I want, by the way).

But still one question: Is the red color on purpose on not? As already mentioned, in my opinion it should not be colored red as it is misleading.
Comment 9 denk 2016-05-11 11:40:54 UTC
Created attachment 98909 [details]
Output in battery section of Plasmaengineexplorer
Comment 10 Kai Uwe Broulik 2016-05-11 11:49:21 UTC
Thanks a lot. Ah, that explains why it shows up. :) I'll fix the tooltip but not sure about the icon. Perhaps have the icon black instead of red in your case?
Comment 11 Kai Uwe Broulik 2016-05-11 12:00:20 UTC
Created attachment 98910 [details]
Fix tooltip and icon

If you can, please test this patch, it will show "No batteries available" if there are none whatsoever and the generic "Battery and Brightness" title when there are only mouse/keyboard like in your case.

It will also change the icon to instead show a red outline to show a black outline with a superimposed "X" as "Batteryies unavailable" which should draw less attention to it.
Comment 12 Kai Uwe Broulik 2016-05-11 12:07:46 UTC
http://paste.opensuse.org/images/53687952.png - is that ok? :)
Comment 13 Kai Uwe Broulik 2016-05-12 12:46:31 UTC
Git commit a19fcfaf90db8ebc6e704917448ccfde7ae0ae59 by Kai Uwe Broulik.
Committed on 12/05/2016 at 12:44.
Pushed by broulik into branch 'Plasma/5.6'.

[Battery Monitor] Use "Has Cumulative" instead of total battery count for tray icon

This fixes the battery icon errorneously showing an empty red battery on a desktop
computer with a wireless mouse/keyboard; instead the "no battery" icon with a
red cross is shown.

CHANGELOG: Battery icon no longer errorneously reports an empty battery if computer has none
Reviewed-By: mgraesslin

M  +1    -1    applets/batterymonitor/package/contents/ui/CompactRepresentation.qml

http://commits.kde.org/plasma-workspace/a19fcfaf90db8ebc6e704917448ccfde7ae0ae59
Comment 14 Kai Uwe Broulik 2016-05-12 12:50:01 UTC
Git commit ed0b2043f7b7b98f889312969dd85ffe8e823d11 by Kai Uwe Broulik.
Committed on 12/05/2016 at 12:49.
Pushed by broulik into branch 'master'.

[Battery Monitor] Take "Has Cumulative" into account for tooltip

This fixes showing "0% charging" on a desktop computer which has a
wireless mouse/keyboard. If there is no battery whatsoever it continues
to show "No batteries available" but for the aforementioned case the
generic "Battery and brightness" is shown in order not to lie to the user :)

CHANGELOG: Battery tooltip no longer shows "0% charging" for computers with wireless mouse/keyboard
Reviewed-By: mgraesslin

M  +4    -0    applets/batterymonitor/package/contents/ui/batterymonitor.qml

http://commits.kde.org/plasma-workspace/ed0b2043f7b7b98f889312969dd85ffe8e823d11
Comment 15 denk 2016-05-12 15:13:48 UTC
Thank you very much for that really fast fix! The screenshot looks good!
And sorry for my late reply!