diff options
Diffstat (limited to 'src/indicator-power.c')
-rw-r--r-- | src/indicator-power.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c index 275e871..64392cd 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -427,11 +427,11 @@ menu_add_device (GtkMenu *menu, &state, &time); + g_debug ("%s: got data from object %s", G_STRFUNC, object_path); + if (kind == UP_DEVICE_KIND_LINE_POWER) return; - g_debug ("%s: got data from object %s", G_STRFUNC, object_path); - /* Process the data */ device_gicons = get_device_icon (kind, state, device_icon); icon = gtk_image_new_from_gicon (device_gicons, @@ -582,6 +582,11 @@ get_primary_device (GVariant *devices) g_debug ("%s: got data from object %s", G_STRFUNC, object_path); + /* Try to fix the case when we get a empty battery bay as a real battery */ + if (state == UP_DEVICE_STATE_UNKNOWN && + percentage == 0) + continue; + /* not battery */ if (kind != UP_DEVICE_KIND_BATTERY) continue; |