[gnome-settings-daemon] power: Stop X from turning our screen off



commit aef54ea441d5c6d27d63dee10c5cd98227d2597c
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Oct 5 21:29:12 2013 +0200

    power: Stop X from turning our screen off
    
    The default timeouts for DPMS in Xorg were finally applied after about
    10 years:
    http://cgit.freedesktop.org/xorg/xserver/commit/?id=6238bd68bd71323f8b4f1808f34dabe2ae447fe3
    
    So work-around that horror.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709114

 plugins/power/gpm-common.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gpm-common.c b/plugins/power/gpm-common.c
index 7367fa5..54838b6 100644
--- a/plugins/power/gpm-common.c
+++ b/plugins/power/gpm-common.c
@@ -29,6 +29,7 @@
 #include <glib/gi18n.h>
 #include <gdk/gdkx.h>
 #include <X11/extensions/XTest.h>
+#include <X11/extensions/dpms.h>
 #include <canberra-gtk.h>
 
 #define GNOME_DESKTOP_USE_UNSTABLE_API
@@ -1150,6 +1151,15 @@ disable_builtin_screensaver (gpointer unused)
 guint
 gsd_power_enable_screensaver_watchdog (void)
 {
+        int dummy;
+
+        /* Make sure that Xorg's DPMS extension never gets in our
+         * way. The defaults are now applied in Fedora 20 from
+         * being "0" by default to being "600" by default */
+        gdk_error_trap_push ();
+        if (DPMSQueryExtension(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &dummy, &dummy))
+                DPMSSetTimeouts (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, 0, 0);
+        gdk_error_trap_pop_ignored ();
         return g_timeout_add_seconds (XSCREENSAVER_WATCHDOG_TIMEOUT,
                                       disable_builtin_screensaver,
                                       NULL);


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