1 |
vostorga 12/01/01 13:39:25 |
2 |
|
3 |
Added: lxpanel-0.5.8-battery-meter.patch |
4 |
Log: |
5 |
Fixes battery metter always showing 100 percent charge, patch thanks to Robert Meyer <r.meyer@××××××××××.org> bug #389581 |
6 |
|
7 |
(Portage version: 2.1.10.11/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/lxde-base/lxpanel/files/lxpanel-0.5.8-battery-meter.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: lxpanel-0.5.8-battery-meter.patch |
16 |
=================================================================== |
17 |
--- src/plugins/batt/batt_sys.c.orig 2011-12-19 15:10:52.690113669 +0100 |
18 |
+++ src/plugins/batt/batt_sys.c 2011-12-19 15:14:36.154315765 +0100 |
19 |
@@ -217,10 +217,24 @@ |
20 |
b->remaining_capacity = b->remaining_energy; |
21 |
} |
22 |
} |
23 |
+ // Start ideapad patch |
24 |
+ if (b->remaining_capacity != -1 && b->last_capacity == -1) { |
25 |
+ if (b->voltage != -1) { |
26 |
+ b->remaining_energy = b->remaining_capacity * b->voltage / 1000; |
27 |
+ b->present_rate = b->present_rate * 1000 / b->voltage; |
28 |
+ } else { |
29 |
+ b->remaining_capacity = b->remaining_energy; |
30 |
+ } |
31 |
+ } |
32 |
+ // end ideapad patch |
33 |
if (b->last_capacity < MIN_CAPACITY) |
34 |
b->percentage = 0; |
35 |
else |
36 |
+ if (b->last_capacity_unit != -1) { |
37 |
b->percentage = ((float) b->remaining_energy * 100.0) / (float) b->last_capacity_unit; |
38 |
+ } else { |
39 |
+ b->percentage = ((float) b->remaining_capacity *100.0) / (float) b->last_capacity; |
40 |
+ } |
41 |
|
42 |
if (b->percentage > 100) |
43 |
b->percentage = 100; |