[gnome-control-center] power: if battery is fully charged but 99%, just round it up



commit f6d5e84d7ff746ee3fb293a60dc3f0bfa72ecc1a
Author: Jonh Wendell <jonh wendell intel com>
Date:   Mon Jan 20 16:43:25 2014 -0200

    power: if battery is fully charged but 99%, just round it up
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701993

 panels/power/cc-power-panel.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index f6febc9..4b32b9d 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -314,6 +314,11 @@ set_primary (CcPowerPanel *panel, UpDevice *device)
   else
     time = time_full;
 
+  /* Sometimes the reported state is fully charged but battery is at 99%,
+     refusing to reach 100%. In these cases, just assume 100%. */
+  if (state == UP_DEVICE_STATE_FULLY_CHARGED && (100.0 - percentage <= 1.0))
+    percentage = 100.0;
+
   details = get_details_string (percentage, state, time);
 
   row = gtk_list_box_row_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]