GNOME Bugzilla – Bug 150899
AC powered system says 'running on battery power'
Last modified: 2005-05-10 05:34:16 UTC
When running the battery charge applet on a PC (no battery), the tooltip says "System is running on battery power. Battery: Not present" which is obviously contradictory. I believe the first sentence should be removed.
This combination (the technically impossible one) comes about if you have no battery present (fair enough), but your AC status is offline (this is probably considered the case if your /proc/acpi/ac_adapter is empty). Personally I consider this to really be a bug in the linux ACPI code (your AC adapter should report online, when on mains power). However it's probably easiest to work around it.
Created attachment 30882 [details] [review] possible fix This patch might be enough to fix it. It seems to still allow it to operate correctly on my laptop. I don't own a desktop computer to test it on though. Can someone with a desktop please test this patch out.
I have a similar issue that fits under this bug's summary: when I first start the battery charge applet it always says that it is running on battery power (whether it is or not). To fix it, I have to kill it. Gnome informs me that the applet unexpectedly and would I like to restart it. I say yes and from then on it works normally, even the next time i log-in/start the program.
Davyd: you patch doesn't fix the problem on my desktop.
Created attachment 46181 [details] [review] patch. The problem is not that hash == NULL, but rather that that code is never even run (since the directory is empty, it doesn't even try to open any files). This patch records whether or not we have an adaptor present and if not, then assumes that we're on a desktop. This works for me on my desktop: "System is running on AC power No battery present" My laptop (Powerbook) doesn't use ACPI so I need someone else to test this.
This looks fine.
Fix commited to HEAD.