wok-6.x rev 6590
Added battery patch to lxpanel to fix 100% battery power bug.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sat Oct 09 04:48:51 2010 +0000 (2010-10-09) |
parents | eab29d604e9a |
children | dede0d1b09f8 |
files | lxpanel/receipt lxpanel/stuff/battery.patch |
line diff
1.1 --- a/lxpanel/receipt Sat Oct 09 04:32:26 2010 +0000 1.2 +++ b/lxpanel/receipt Sat Oct 09 04:48:51 2010 +0000 1.3 @@ -22,6 +22,8 @@ 1.4 #patch -p1 -i ../stuff/Fix-failure-to-react-to-keyboard-map-changes-initiat.patch 1.5 # Devnote : this patch shouldn't be necessary in next release of lxpanel (current : 0.5.6). 1.6 patch -p1 -i ../stuff/battery-plugin.patch 1.7 + # patch to fix 100% battery bug with battery plugin 1.8 + patch -p1 -i ../stuff/battery.patch 1.9 ./configure \ 1.10 --prefix=/usr \ 1.11 --sysconfdir=/etc \
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/lxpanel/stuff/battery.patch Sat Oct 09 04:48:51 2010 +0000 2.3 @@ -0,0 +1,44 @@ 2.4 +--- lxpanel-0.5.5/src/plugins/batt/batt_sys.c Sat Feb 6 20:45:38 2010 2.5 ++++ lxpanel-0.5.5-orig/src/plugins/batt/batt_sys.c Sat Jul 24 18:48:20 2010 2.6 +@@ -38,6 +38,13 @@ 2.7 + battery* battery_new() { 2.8 + static int battery_num = 1; 2.9 + battery * b = g_new0 ( battery, 1 ); 2.10 ++ battery_reset(b); 2.11 ++ b->battery_num = battery_num; 2.12 ++ battery_num++; 2.13 ++ return b; 2.14 ++ } 2.15 ++ 2.16 ++void battery_reset( battery * b) { 2.17 + b->type_battery = TRUE; 2.18 + b->capacity_unit = "mAh"; 2.19 + b->last_capacity_unit = -1; 2.20 +@@ -49,9 +56,6 @@ 2.21 + b->remaining_capacity = -1; 2.22 + b->present_rate = -1; 2.23 + b->state = NULL; 2.24 +- b->battery_num = battery_num; 2.25 +- battery_num++; 2.26 +- return b; 2.27 + } 2.28 + 2.29 + 2.30 +@@ -136,6 +140,8 @@ 2.31 + }; 2.32 + const gchar *sys_file; 2.33 + 2.34 ++ battery_reset(b); 2.35 ++ 2.36 + while ( (sys_file = sys_list[i]) != NULL ) { 2.37 + 2.38 + gchar *file_content; 2.39 +@@ -150,7 +156,7 @@ 2.40 + b->state = "available"; 2.41 + } 2.42 + else if ( strcmp("energy_now", sys_file ) == 0 ) { 2.43 +- b->remaining_capacity = get_unit_value((gchar*) file_content) / 1000; 2.44 ++ b->remaining_energy = get_unit_value((gchar*) file_content) / 1000; 2.45 + if (!b->state) 2.46 + b->state = "available"; 2.47 + }