Bug appears in 1.4.4 & 1.6.0: laptop (lenovo thinkpad X230) w/ xubuntu 15.10, has recently started happening & I'm not sure what's caused the change.
When plugged in the battery will charge to full, I’ll get the power manager notification "You battery is fully charged" then almost immediately "Your battery is charging", and it'll just repeat back & forth, one replacing the other roughly every second.
Notes: I implemented a 120 second "flap timer" that is reset each time one of the notifications specifically for battery full/charging/discharging occurs while the other types of notifications are shown as usual.
There is one small caveat which is that the very first read of the flap_timer is an uninitialized read yet after that it's initialized to the systems current timer using the monotonic clock call from glib which I assumed was appropriate.
Also the last charge state the system settles into once flapping stops may not be shown and it would be trivial to set an event callback timer each time a notification is suppressed to eventually show the "final state" if flapping stopped since the timer was set.
TODO: Adding a gui to configure the flapping timeout may be desirable. As-is the value is hardcoded and always enabled for all battery/ups devices connected.
Feel free to use the code and I can certify this patch was 100% authored by me and I have the rights to grant usage of the code to this xfce project under it's original license terms.
Just conjecture, but reproducibility might have something to do with lithium-ion battery capacity loss. When I noticed this, the last full charge of my battery was suspiciously close to 95% of design capacity:
$ acpitool -B
Battery #1 (closed) : present
Remaining capacity : unknown, 98.58%, 00:02:27
Design capacity : 5200 mA
Last full capacity : 4945 mA, 95.10% of design capacity
Capacity loss : 4.904%
Present rate : 1707 mA
Charging state : Charging
Battery type : Li-ion
Model number : 45N1005
Serial number : 35581
Interesting point Nathaniel. My laptop battery is completely dead because it's so old, so this may be a factor. I believe I just turned the notification off!
Just a heads up for anyone else dealing with this issue.
Problem:
Just like the author of OP I am running Thinkpad X230. I am running MX Linux with XFCE 4.16 and I am getting spammed to high heaven with "You battery is fully charged" then almost immediately "Your battery is charging" messages. What is odd I don't see any messages in dmesg -wH indicating anything when it happens....assuming that's where anything battery related messages would show.
Solution/Fix:
Powered off Thinkpad.
Unplugged power cable.
Took out battery from Thinkpad.
Hold down power button for at the very least 30 seconds......1 minute to be safe.
Put everything back and power Thinkpad.
Battery notification spamming gone! :D
Sounds like it's a hardware issue. Perhaps its a software(XFCE,Linux) + Hardware issue..? Anyways, just glad that at least for now it's works. Hope this helps someone else.
I have seen this issue myself meanwhile and have concluded that it is indeed some sort of hardware failure.
I considered the workaround in the code that was previously posted as a patch, but I find the 'flapping time' arbitrary and hard to define sanely.
My suggestion would therefore be to just disable notifications on systems where they are buggy. Adding workarounds in the code might lead to bad situations in other, more sane/regular cases and don't help with keeping the code easily testable and maintainable.
I'm having this same issue with a brand new Lenovo Carbon X1 10th Gen and XFCE 4.16.0. The battery on this model is not easily removable, at least not without disassembling the bottom and voiding the warranty, so I can't try out @Rudy-MS's fix.
I understand the desire to not add workarounds in the code, but could this one be configurable somehow? Or how about a setting to disable the "battery fully charged" notification? Losing only that notification would be preferable to losing all of them.
As @NathanielBeaver documented, this has been an issue for a long time — longer than some XFCE users I know have been alive. @alexiri suggests that this hasn't been solved because developers don't want special case workarounds in the code. That's reasonable. However, this actually could be solved by an improvement in the user interface that would benefit all users.
Currently, Power Manager is treating these two notification classes as equally important:
Charging state has changed.
Battery is low or critical.
However, those are very different to end-users. Some people, including me, do not want to ever be distracted by a message popping up alerting them that everything is fine ("Battery is 100%"). Nearly everyone, even yours truly, wants a notification if the battery is low and they need to plug in.
The solution is to separate the toggle switches in the preferences or offer a tri-state with radio buttons:
Show no notifications ever.
Show important notifications, like battery low.
Show all notifications, including changes in charging state.
Thanks for considering this idea.
[Ignore the following text. The only way to fix a minor typo above is to convince gitlab that I am not spam. So, call me Ishmael.]
I have this problem with xfce4 4.18 on a Dynabook Tecra laptop. It started about a year after I got the laptop. The problem is intermittent. I will sometimes get notices incessantly for long periods but sometimes get none for long periods. By long periods, I mean periods like half an hour to hours at a time. The problem is worse because setting the Settings option 'Status notifications' to off doesn't work but at least toggling it on then off does stop the notifications, at least temporarily. As b 9 indicated 5 months ago, I care about critically low battery but the notifications that the battery is discharging then 100% charged do not help me. The incessant alerts are very disruptive.