batt: fix #720, status is charged, when discharge rate is 0
authorHenry Gebhardt <hsggebhardt@gmail.com>
Wed, 11 Feb 2015 05:28:51 +0000 (00:28 -0500)
committerHenry Gebhardt <hsggebhardt@gmail.com>
Sun, 15 Feb 2015 06:08:15 +0000 (01:08 -0500)
https://sourceforge.net/p/lxde/bugs/720/

plugins/batt/batt_sys.c

index 9262220..96a56b5 100644 (file)
@@ -325,9 +325,10 @@ gboolean battery_is_charging( battery *b )
 {
     if (!b->state)
         return TRUE; // Same as "Unkown"
-    return ( strcasecmp( b->state, "Unknown" ) == 0 ||
-             strcasecmp( b->state, "Full" ) == 0
-             || strcasecmp( b->state, "Charging" ) == 0 );
+    return ( strcasecmp( b->state, "Unknown" ) == 0
+            || strcasecmp( b->state, "Full" ) == 0
+            || strcasecmp( b->state, "Charging" ) == 0
+            || b->current_now == 0 ); /* bug sf.net, #720 */
 }
 
 gint battery_get_remaining( battery *b )