[gnome-desktop] When setting the DPMS mode manually, clear the timeouts



commit 1e9027cfacaf4d7571780e05c0b03e4521ae9a9d
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 3 16:19:23 2011 +0100

    When setting the DPMS mode manually, clear the timeouts
    
    Based on a patch from Michael Vogt, many thanks.
    
    Resolves https://bugzilla.gnome.org/show_bug.cgi?id=660482

 libgnome-desktop/gnome-rr.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c
index a506c4d..e23e516 100644
--- a/libgnome-desktop/gnome-rr.c
+++ b/libgnome-desktop/gnome-rr.c
@@ -1176,6 +1176,8 @@ out:
 
 /**
  * gnome_rr_screen_set_dpms_mode:
+ *
+ * This method also disables the DPMS timeouts.
  **/
 gboolean
 gnome_rr_screen_set_dpms_mode (GnomeRRScreen *screen,
@@ -1227,6 +1229,21 @@ gnome_rr_screen_set_dpms_mode (GnomeRRScreen *screen,
                              "Could not change DPMS mode");
         goto out;
     }
+
+    gdk_error_trap_push ();
+    ret = DPMSSetTimeouts (screen->priv->xdisplay, 0, 0, 0);
+    if (gdk_error_trap_pop ())
+        ret = FALSE;
+
+    if (!ret) {
+        ret = FALSE;
+        g_set_error_literal (error,
+                             GNOME_RR_ERROR,
+                             GNOME_RR_ERROR_UNKNOWN,
+                             "Could not set DPMS timeouts");
+        goto out;
+    }
+
 out:
     return ret;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]