summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Ostorga <vostorga@gentoo.org>2012-01-01 13:39:25 +0000
committerVictor Ostorga <vostorga@gentoo.org>2012-01-01 13:39:25 +0000
commit8a5b481e02452d801e29ebf70c4a9ee6bc4e8b56 (patch)
treece4a5a4ae657123b63b59226e4bb7f23796ef4b1 /lxde-base/lxpanel/files
parentmedia-libs/gegl: 0.1.8 (diff)
downloadgentoo-2-8a5b481e02452d801e29ebf70c4a9ee6bc4e8b56.tar.gz
gentoo-2-8a5b481e02452d801e29ebf70c4a9ee6bc4e8b56.tar.bz2
gentoo-2-8a5b481e02452d801e29ebf70c4a9ee6bc4e8b56.zip
Fixes battery metter always showing 100 percent charge, patch thanks to Robert Meyer <r.meyer@net-wizard.org> bug #389581
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'lxde-base/lxpanel/files')
-rw-r--r--lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch b/lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch
new file mode 100644
index 000000000000..99ae7bc6dbf6
--- /dev/null
+++ b/lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch
@@ -0,0 +1,27 @@
+--- src/plugins/batt/batt_sys.c.orig 2011-12-19 15:10:52.690113669 +0100
++++ src/plugins/batt/batt_sys.c 2011-12-19 15:14:36.154315765 +0100
+@@ -217,10 +217,24 @@
+ b->remaining_capacity = b->remaining_energy;
+ }
+ }
++ // Start ideapad patch
++ if (b->remaining_capacity != -1 && b->last_capacity == -1) {
++ if (b->voltage != -1) {
++ b->remaining_energy = b->remaining_capacity * b->voltage / 1000;
++ b->present_rate = b->present_rate * 1000 / b->voltage;
++ } else {
++ b->remaining_capacity = b->remaining_energy;
++ }
++ }
++ // end ideapad patch
+ if (b->last_capacity < MIN_CAPACITY)
+ b->percentage = 0;
+ else
++ if (b->last_capacity_unit != -1) {
+ b->percentage = ((float) b->remaining_energy * 100.0) / (float) b->last_capacity_unit;
++ } else {
++ b->percentage = ((float) b->remaining_capacity *100.0) / (float) b->last_capacity;
++ }
+
+ if (b->percentage > 100)
+ b->percentage = 100;