[gnome-control-center] screen: Set idle-delay to the same value as DPMS timeout
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] screen: Set idle-delay to the same value as DPMS timeout
- Date: Tue, 8 Feb 2011 15:23:25 +0000 (UTC)
commit d6a2046a0f1c9c8d943fe720b10fc314941a40fc
Author: Bastien Nocera <hadess hadess net>
Date: Tue Feb 8 15:20:49 2011 +0000
screen: Set idle-delay to the same value as DPMS timeout
So that the user and session are idle when DPMS kicks in.
panels/screen/cc-screen-panel.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/panels/screen/cc-screen-panel.c b/panels/screen/cc-screen-panel.c
index 35349cb..bff1a16 100644
--- a/panels/screen/cc-screen-panel.c
+++ b/panels/screen/cc-screen-panel.c
@@ -32,6 +32,7 @@ struct _CcScreenPanelPrivate
{
GSettings *lock_settings;
GSettings *gsd_settings;
+ GSettings *session_settings;
GCancellable *cancellable;
GtkBuilder *builder;
GDBusProxy *proxy;
@@ -80,6 +81,11 @@ cc_screen_panel_dispose (GObject *object)
g_object_unref (priv->gsd_settings);
priv->gsd_settings = NULL;
}
+ if (priv->session_settings)
+ {
+ g_object_unref (priv->session_settings);
+ priv->session_settings = NULL;
+ }
if (priv->cancellable != NULL)
{
g_object_unref (priv->cancellable);
@@ -289,6 +295,7 @@ dpms_combo_changed_cb (GtkWidget *widget, CcScreenPanel *self)
/* set both battery and ac keys */
g_settings_set_int (self->priv->gsd_settings, "sleep-display-ac", value);
g_settings_set_int (self->priv->gsd_settings, "sleep-display-battery", value);
+ g_settings_set (self->priv->session_settings, "idle-delay", "u", value);
}
static void
@@ -414,6 +421,7 @@ cc_screen_panel_init (CcScreenPanel *self)
G_CALLBACK (on_lock_settings_changed),
self);
self->priv->gsd_settings = g_settings_new ("org.gnome.settings-daemon.plugins.power");
+ self->priv->session_settings = g_settings_new ("org.gnome.desktop.session");
/* bind the auto dim checkbox */
widget = WID ("screen_auto_reduce_checkbutton");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]