gnome-power-manager r3398 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r3398 - in trunk: . src
- Date: Mon, 13 Apr 2009 08:08:06 +0000 (UTC)
Author: rhughes
Date: Mon Apr 13 08:08:06 2009
New Revision: 3398
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3398&view=rev
Log:
2009-04-13 Richard Hughes <richard hughsie com>
* src/gpm-dpms.c: (gpm_dpms_clear_timeouts), (gpm_dpms_init):
Ensure we clear the default DPMS timeout of 1200s. Should fix #576169
Modified:
trunk/ChangeLog
trunk/src/gpm-dpms.c
Modified: trunk/src/gpm-dpms.c
==============================================================================
--- trunk/src/gpm-dpms.c (original)
+++ trunk/src/gpm-dpms.c Mon Apr 13 08:08:06 2009
@@ -328,6 +328,30 @@
}
/**
+ * gpm_dpms_clear_timeouts:
+ **/
+static gboolean
+gpm_dpms_clear_timeouts (GpmDpms *dpms)
+{
+ gboolean ret = FALSE;
+
+ /* never going to work */
+ if (!dpms->priv->dpms_capable) {
+ egg_debug ("not DPMS capable");
+ goto out;
+ }
+
+#ifdef HAVE_DPMS_EXTENSION
+ egg_debug ("set timeouts to zero");
+ ret = DPMSSetTimeouts (GDK_DISPLAY (), 0, 0, 0);
+#else
+ egg_warning ("no DPMS extension");
+#endif
+out:
+ return ret;
+}
+
+/**
* gpm_dpms_class_init:
**/
static void
@@ -358,6 +382,9 @@
/* DPMSCapable() can never change for a given display */
dpms->priv->dpms_capable = DPMSCapable (GDK_DISPLAY ());
dpms->priv->timer_id = g_timeout_add_seconds (GPM_DPMS_POLL_TIME, (GSourceFunc)gpm_dpms_poll_mode_cb, dpms);
+
+ /* ensure we clear the default timeouts (Standby: 1200s, Suspend: 1800s, Off: 2400s) */
+ gpm_dpms_clear_timeouts (dpms);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]