[gnome-settings-daemon/docking-stations] Before suspending, check if external outputs are disconnected instead of off
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/docking-stations] Before suspending, check if external outputs are disconnected instead of off
- Date: Tue, 6 Dec 2011 01:17:49 +0000 (UTC)
commit c94a03ef65c3d11bca29f4cbda916eb05018b21a
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 5 16:43:14 2011 -0600
Before suspending, check if external outputs are disconnected instead of off
The policy is, in summary, 'if all external outputs are disconnected, we suspend'
if the lid is closed.
Signed-off-by: Federico Mena Quintero <federico gnome org>
plugins/power/gsd-power-manager.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index c0836d2..b0569e7 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2109,12 +2109,12 @@ is_laptop (GnomeRRScreen *screen, GnomeRROutputInfo *output)
}
static gboolean
-non_laptop_outputs_are_all_off (GnomeRRScreen *screen)
+non_laptop_outputs_are_all_disconnected (GnomeRRScreen *screen)
{
GnomeRRConfig *config;
GnomeRROutputInfo **outputs;
int i;
- gboolean all_off;
+ gboolean all_disco;
config = gnome_rr_config_new_current (screen, NULL); /* NULL-GError */
if (!config)
@@ -2125,17 +2125,17 @@ non_laptop_outputs_are_all_off (GnomeRRScreen *screen)
if (is_laptop (screen, outputs[i]))
continue;
- if (gnome_rr_output_info_is_active (outputs[i])) {
- all_off = FALSE;
+ if (gnome_rr_output_info_is_connected (outputs[i])) {
+ all_disco = FALSE;
goto out;
}
}
- all_off = TRUE;
+ all_disco = TRUE;
out:
g_object_unref (config);
- return all_off;
+ return all_disco;
}
static void
@@ -2182,11 +2182,11 @@ do_lid_closed_action (GsdPowerManager *manager)
}
/* perform policy action */
- if (non_laptop_outputs_are_all_off (manager->priv->x11_screen)) {
+ if (non_laptop_outputs_are_all_disconnected (manager->priv->x11_screen)) {
g_debug ("lid is closed; suspending or hibernating");
do_power_action_type (manager, action_type);
} else
- g_debug ("lid is closed; not suspending nor hibernating since some external monitor outputs are still on");
+ g_debug ("lid is closed; not suspending nor hibernating since some external monitor outputs are still connected");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]