[gnome-settings-daemon] power: Ensure the critical battery beep is stopped when the AC is inserted
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Ensure the critical battery beep is stopped when the AC is inserted
- Date: Mon, 22 Aug 2011 11:48:58 +0000 (UTC)
commit cfd4aeae951d026f1208791d2a0b0a6835838da3
Author: Richard Hughes <richard hughsie com>
Date: Mon Aug 22 12:44:26 2011 +0100
power: Ensure the critical battery beep is stopped when the AC is inserted
Ensure the beeping is stopped when the AC is unplugged and don't wait for the
lid state to also change.
plugins/power/gsd-power-manager.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 4c5b9ae..261f02e 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2118,13 +2118,6 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
{
gboolean tmp;
- /* same state */
- tmp = up_client_get_lid_is_closed (manager->priv->up_client);
- if (manager->priv->lid_is_closed == tmp)
- return;
- manager->priv->lid_is_closed = tmp;
-
-
/* if we are playing a critical charge sound loop on AC, stop it */
if (!up_client_get_on_battery (client) &&
manager->priv->critical_alert_timeout_id > 0) {
@@ -2132,6 +2125,12 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
play_loop_stop (manager);
}
+ /* same state */
+ tmp = up_client_get_lid_is_closed (manager->priv->up_client);
+ if (manager->priv->lid_is_closed == tmp)
+ return;
+ manager->priv->lid_is_closed = tmp;
+
/* fake a keypress */
if (tmp)
do_lid_closed_action (manager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]