-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong tooltip and left click info in pending-charge state #295
Comments
This is probably a misinterpretation of reported state from solid. This is in our code: QString BatteryHelper::stateToString(Solid::Battery::ChargeState state)
{
switch (state)
{
case Solid::Battery::NoCharge:
return tr("Empty");
case Solid::Battery::Discharging:
return tr("Discharging");
case Solid::Battery::FullyCharged:
return tr("Fully charged");
case Solid::Battery::Charging:
default:
return tr("Charging");
}
} whereas the solid doc/comment on the enum says: /**
* This enum type defines charge state of a battery
*
* - NoCharge : Battery charge is stable, not charging or discharging or
* the state is Unknown
* - Charging : Battery is charging
* - Discharging : Battery is discharging
* - FullyCharged: The battery is fully charged; a battery not necessarily
* charges up to 100%
*/
enum ChargeState { NoCharge, Charging, Discharging, FullyCharged }; We should probably revisit the logic and interpretation of the |
I started to see such tooltips. For a few minutes, the tooltip said "Empty (99%)", while the laptop was plugged in. The icon was affected too. I had time only for taking a screenshot: I'm sure it didn't happen before; otherwise, I'd notice it. Because of that, I think it may be a new problem in |
In my case, the laptop was plugged in for hours. "99%" was normal — I'd seen it with other plugged laptops too; it should be related to automatic battery maintenance — but the unplugged icon and the word "Empty" were quite unusual. |
It happened again: This is probably not related — I can't see any relation — but this time, I logged out to log into KDE-Plasma, to see if it showed the same thing, but KDE failed to start, thanks to
|
It's still a mystery to me why I hadn't seen this before, but as @palinek rightly said, That simple change (Empty → Stable) seems enough for solving the problem.
I think the connection emblem shouldn't be shown in the "Stable" state. We've never been interested in the adapter directly:
So, IMO, we don't need to touch the current icon handling. |
`Solid::Battery::NoCharge` is interpreted as "Stable", not "Empty". "Empty" is used only when a completely empty battery is in the stable state (i.e., it isn't charging). The "charge emblem" isn't shown in the stable state because there's no charging in this state. Moreover, the info we get is about the battery, not the adapter connection. Closes #295
`Solid::Battery::NoCharge` is interpreted as "Stable", not "Empty". "Empty" is used only when a completely empty battery is in the stable state (i.e., it isn't charging). The "charge emblem" isn't shown in the stable state because there's no charging in this state. Moreover, the info we get is about the battery, not the adapter connection. Closes #295
In rare circumstances (probably unplugging power supply for a short time, 5 min) the battery will not be charged immediately:
upower -i /org/freedesktop/UPower/devices/battery_BAT
In this state left click on the icon results in "no battery" and tooltip says "Battery empty" too.
upower manual mentions 2 states :
Expected Behavior
No wrong tooltip infos, and icon should display power adapter connected when in fact it is.
Possible Solution
Steps to Reproduce (for bugs)
Context
Noticed only testing in #294 , usually the power adapter is longer disconnected than some minutes. It looks like the battery has to go under ~95% to be recharged immediately or at all, at 97% it hangs always there.
System Information
The text was updated successfully, but these errors were encountered: