GNOME Bugzilla – Bug 709576
Notifications not showing on critical battery
Last modified: 2013-10-30 12:28:56 UTC
After I updated to 3.10 (F20) my computer no longer handles low battery conditions. I don't get any notifications and the system doesn't try to hibernate. These worked fine in 3.8 (F19). Also, in the Power settings panel I am unable to click on the "When battery power is critical" option and I'm not sure why. Perhaps if the system has a battery and hibernate is not available for whatever reason we should explain that to the user. $ gdbus call --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1 --method org.freedesktop.login1.Manager.CanHibernate ('challenge',)
(In reply to comment #0) > After I updated to 3.10 (F20) my computer no longer handles low battery > conditions. I don't get any notifications and the system doesn't try to > hibernate. These worked fine in 3.8 (F19). > > Also, in the Power settings panel I am unable to click on the "When battery > power is critical" option and I'm not sure why. logind bug: https://bugs.freedesktop.org/show_bug.cgi?id=70237 > Perhaps if the system has a battery and hibernate is not available for whatever > reason we should explain that to the user. We have no way to know why hibernation isn't available, and hibernation is going away as a separate concept on x86 machines. I filed: https://bugs.freedesktop.org/show_bug.cgi?id=70244 But this makes for horrible UI, as we don't have an easy way to repair whatever problems there might be (do we launch Disks to try and help the user make a bigger swap?). > $ gdbus call --system --dest org.freedesktop.login1 --object-path > /org/freedesktop/login1 --method org.freedesktop.login1.Manager.CanHibernate > ('challenge',) This is what causes hibernation not to be available: https://bugs.freedesktop.org/show_bug.cgi?id=70237 Let's refocus this bug on the missing notifications. By default, we would show the critical warning when there's 2 minutes of battery left: org.gnome.settings-daemon.plugins.power use-time-for-policy org.gnome.settings-daemon.plugins.power time-critical Can you capture a gnome-settings-daemon --replace --debug when this happens? We also have such a case in the test suite as "test_action_critical_battery".
Created attachment 257019 [details] [review] power: Fix notification never showing up The composite device never sends out a "changed" signal, so we missed looking at its new warning state to emit critical warnings.
Created attachment 257030 [details] [review] power: Fix notification never showing up The composite device never sends out a "changed" signal, so we missed looking at its new warning state to emit critical warnings.
Created attachment 257031 [details] [review] power: Add test case for lack of warning on startup
This affected all notifications, but only on startup. Devices that changed over time weren't affected. And it was broken in 3.8 as well!
Created attachment 257034 [details] [review] power: Fix notification never showing up Added devices on coldplug were never actually processed, and the warning level of the composite device was set to its current value, so that a change never triggered. This only happened on startup, and affected GNOME 3.8 as well.
Created attachment 257035 [details] [review] power: Add test case for lack of warning on startup
Pushed to master for GNOME 3.10.1 Attachment 257034 [details] pushed as dda467f - power: Fix notification never showing up Attachment 257035 [details] pushed as d04911e - power: Add test case for lack of warning on startup
Awesome. Thank you!
(In reply to comment #8) > Pushed to master for GNOME 3.10.1 > > Attachment 257034 [details] pushed as dda467f - power: Fix notification never showing up Should this one be pushed to gnome-3-8 too?
Created attachment 257427 [details] [review] power: Fix notification never showing up Added devices on coldplug were never actually processed, and the warning level of the composite device was set to its current value, so that a change never triggered. This only happened on startup, and affected GNOME 3.8 as well. https://bugzilla.gnome.org/show_bug.cgi?id=709576 Conflicts: plugins/power/gsd-power-manager.c
Reopening for GNOME 3.8. It will need testing.
I wonder if this isn't enough: diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c index 645df66..d01f116 100644 --- a/plugins/power/gsd-power-manager.c +++ b/plugins/power/gsd-power-manager.c @@ -1100,6 +1100,7 @@ engine_coldplug (GsdPowerManager *manager) for (i=0;i<array->len;i++) { device = g_ptr_array_index (array, i); + g_ptr_array_add (manager->priv->devices_array, g_object_ref (device)); engine_device_add (manager, device); engine_check_recall (manager, device); }
(In reply to comment #13) This causes g-s-d to export 2 battery devices which gets displayed in gnome-shell as 2 identical batteries.
I just tested this on F19's 3.8.5 g-s-d and I do get low battery notifications. Closing.