diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-17 12:06:15 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-17 17:41:40 +0200 |
commit | ea3b67eecf693dad0b3046bee2d081f6927687d8 (patch) | |
tree | bd88994299660d38e3ce932eaa869ab68337e199 | |
parent | bcb3e743218cc101101b59c046113ba106217c84 (diff) | |
download | gnome-settings-daemon-ea3b67eecf693dad0b3046bee2d081f6927687d8.tar.gz |
power: Hide notifications when the warning level changes
And stop the warning sound as well.
That means, not when the battery state changes, or when
resuming, only when the warning level changes.
-rw-r--r-- | plugins/power/gsd-power-manager.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c index 236f8bc8..d4c5ea62 100644 --- a/plugins/power/gsd-power-manager.c +++ b/plugins/power/gsd-power-manager.c @@ -799,6 +799,7 @@ engine_device_warning_changed_cb (UpDevice *device, GParamSpec *pspec, GsdPowerM /* FIXME: this only handles one notification * for the whole system, instead of one per device */ g_debug ("fully charged or charging, hiding notifications if any"); + play_loop_stop (&manager->priv->critical_alert_timeout_id); notify_close_if_showing (&manager->priv->notification_low); notify_close_if_showing (&manager->priv->notification_ups_discharging); } @@ -1222,13 +1223,6 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager) { gboolean tmp; - if (!up_client_get_on_battery (client)) { - /* if we are playing a critical charge sound loop on AC, stop it */ - play_loop_stop (&manager->priv->critical_alert_timeout_id); - notify_close_if_showing (&manager->priv->notification_low); - main_battery_or_ups_low_changed (manager, FALSE); - } - if (!manager->priv->lid_is_present) return; @@ -2227,12 +2221,6 @@ handle_suspend_actions (GsdPowerManager *manager) static void handle_resume_actions (GsdPowerManager *manager) { - /* close existing notifications on resume, the system power - * state is probably different now */ - notify_close_if_showing (&manager->priv->notification_low); - notify_close_if_showing (&manager->priv->notification_ups_discharging); - main_battery_or_ups_low_changed (manager, FALSE); - /* ensure we turn the panel back on after resume */ backlight_enable (manager); |