diff options
author | root <root@rshg054.dnsready.net> | 2013-02-10 01:12:52 -0800 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-02-10 01:12:52 -0800 |
commit | 1bb2648cde916ac27d3dd75d7b64a4ddc89787b7 (patch) | |
tree | 016bfa1969323404c37dbef29cfc7242a5a8e9f3 /extra/gnome-settings-daemon | |
parent | e9c244cac8e5dc1c59c7e8b7bc885fef04224b70 (diff) |
Sun Feb 10 01:12:35 PST 2013
Diffstat (limited to 'extra/gnome-settings-daemon')
-rw-r--r-- | extra/gnome-settings-daemon/screensaver.patch | 145 | ||||
-rw-r--r-- | extra/gnome-settings-daemon/systemd-fallback.patch | 154 |
2 files changed, 0 insertions, 299 deletions
diff --git a/extra/gnome-settings-daemon/screensaver.patch b/extra/gnome-settings-daemon/screensaver.patch deleted file mode 100644 index bbcfe3430..000000000 --- a/extra/gnome-settings-daemon/screensaver.patch +++ /dev/null @@ -1,145 +0,0 @@ -From b47e4019a12ac84fba31e1c631d878ce03fa3808 Mon Sep 17 00:00:00 2001 -From: Rui Matos <tiagomatos@gmail.com> -Date: Wed, 17 Oct 2012 22:44:54 +0000 -Subject: power: Add a watchdog to keep X's builtin screen saver disabled - -X's builtin screen saver may activate DPMS. Since we want to activate -DPMS ourselves according to our own policy we must make sure that X's -screen saver remains disabled. - -This code is a copy of the original found in gs-watcher-x11.c from -gnome-screensaver which stopped being used in GNOME 3.6. - -https://bugzilla.gnome.org/show_bug.cgi?id=686339 ---- -diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c -index 0e06495..070cf32 100644 ---- a/plugins/power/gsd-power-manager.c -+++ b/plugins/power/gsd-power-manager.c -@@ -27,6 +27,7 @@ - #include <stdio.h> - #include <sys/wait.h> - #include <glib/gi18n.h> -+#include <gdk/gdkx.h> - #include <gtk/gtk.h> - #include <libupower-glib/upower.h> - #include <libnotify/notify.h> -@@ -80,6 +81,8 @@ - /* Keep this in sync with gnome-shell */ - #define SCREENSAVER_FADE_TIME 10 /* seconds */ - -+#define XSCREENSAVER_WATCHDOG_TIMEOUT 120 /* seconds */ -+ - enum { - GSD_POWER_IDLETIME_NULL_ID, - GSD_POWER_IDLETIME_DIM_ID, -@@ -197,6 +200,7 @@ struct GsdPowerManagerPrivate - GsdPowerIdleMode current_idle_mode; - guint lid_close_safety_timer_id; - GtkStatusIcon *status_icon; -+ guint xscreensaver_watchdog_timer_id; - }; - - enum { -@@ -3621,6 +3625,77 @@ engine_session_active_changed_cb (GnomeSettingsSession *session, - idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL); - } - -+/* This timer goes off every few minutes, whether the user is idle or not, -+ to try and clean up anything that has gone wrong. -+ -+ It calls disable_builtin_screensaver() so that if xset has been used, -+ or some other program (like xlock) has messed with the XSetScreenSaver() -+ settings, they will be set back to sensible values (if a server extension -+ is in use, messing with xlock can cause the screensaver to never get a wakeup -+ event, and could cause monitor power-saving to occur, and all manner of -+ heinousness.) -+ -+ This code was originally part of gnome-screensaver, see -+ http://git.gnome.org/browse/gnome-screensaver/tree/src/gs-watcher-x11.c?id=fec00b12ec46c86334cfd36b37771cc4632f0d4d#n530 -+ */ -+static gboolean -+disable_builtin_screensaver (gpointer unused) -+{ -+ int current_server_timeout, current_server_interval; -+ int current_prefer_blank, current_allow_exp; -+ int desired_server_timeout, desired_server_interval; -+ int desired_prefer_blank, desired_allow_exp; -+ -+ XGetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), -+ ¤t_server_timeout, -+ ¤t_server_interval, -+ ¤t_prefer_blank, -+ ¤t_allow_exp); -+ -+ desired_server_timeout = current_server_timeout; -+ desired_server_interval = current_server_interval; -+ desired_prefer_blank = current_prefer_blank; -+ desired_allow_exp = current_allow_exp; -+ -+ desired_server_interval = 0; -+ -+ /* I suspect (but am not sure) that DontAllowExposures might have -+ something to do with powering off the monitor as well, at least -+ on some systems that don't support XDPMS? Who know... */ -+ desired_allow_exp = AllowExposures; -+ -+ /* When we're not using an extension, set the server-side timeout to 0, -+ so that the server never gets involved with screen blanking, and we -+ do it all ourselves. (However, when we *are* using an extension, -+ we tell the server when to notify us, and rather than blanking the -+ screen, the server will send us an X event telling us to blank.) -+ */ -+ desired_server_timeout = 0; -+ -+ if (desired_server_timeout != current_server_timeout -+ || desired_server_interval != current_server_interval -+ || desired_prefer_blank != current_prefer_blank -+ || desired_allow_exp != current_allow_exp) { -+ -+ g_debug ("disabling server builtin screensaver:" -+ " (xset s %d %d; xset s %s; xset s %s)", -+ desired_server_timeout, -+ desired_server_interval, -+ (desired_prefer_blank ? "blank" : "noblank"), -+ (desired_allow_exp ? "expose" : "noexpose")); -+ -+ XSetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), -+ desired_server_timeout, -+ desired_server_interval, -+ desired_prefer_blank, -+ desired_allow_exp); -+ -+ XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE); -+ } -+ -+ return TRUE; -+} -+ - gboolean - gsd_power_manager_start (GsdPowerManager *manager, - GError **error) -@@ -3778,6 +3853,9 @@ gsd_power_manager_start (GsdPowerManager *manager, - /* set the initial dim time that can adapt for the user */ - refresh_idle_dim_settings (manager); - -+ manager->priv->xscreensaver_watchdog_timer_id = g_timeout_add_seconds (XSCREENSAVER_WATCHDOG_TIMEOUT, -+ disable_builtin_screensaver, -+ NULL); - gnome_settings_profile_end (NULL); - return TRUE; - } -@@ -3829,6 +3907,11 @@ gsd_power_manager_stop (GsdPowerManager *manager) - - g_clear_object (&manager->priv->idletime); - g_clear_object (&manager->priv->status_icon); -+ -+ if (manager->priv->xscreensaver_watchdog_timer_id > 0) { -+ g_source_remove (manager->priv->xscreensaver_watchdog_timer_id); -+ manager->priv->xscreensaver_watchdog_timer_id = 0; -+ } - } - - static void --- -cgit v0.9.0.2 diff --git a/extra/gnome-settings-daemon/systemd-fallback.patch b/extra/gnome-settings-daemon/systemd-fallback.patch deleted file mode 100644 index da0496623..000000000 --- a/extra/gnome-settings-daemon/systemd-fallback.patch +++ /dev/null @@ -1,154 +0,0 @@ -commit b9ded09387f0b99ece97baee18595eb9e86a5b9b -Author: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> -Date: Mon Mar 12 01:52:54 2012 +0100 - - Fallback to CK if systemd is not available - - Be nice to distributions where systemd is optional. This will select - the code path at runtime depending on whether the system was booted - using systemd. - -diff --git a/configure.ac b/configure.ac -index 3b4789f..d522852 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -299,7 +299,7 @@ AC_ARG_ENABLE([systemd], - [with_systemd=$enableval], - [with_systemd=no]) - if test "$with_systemd" = "yes" ; then -- PKG_CHECK_MODULES(SYSTEMD, [libsystemd-login]) -+ PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon libsystemd-login]) - AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is used for session tracking]) - SESSION_TRACKING=systemd - else -diff --git a/gnome-settings-daemon/gnome-settings-session.c b/gnome-settings-daemon/gnome-settings-session.c -index 5786300..83fe21e 100644 ---- a/gnome-settings-daemon/gnome-settings-session.c -+++ b/gnome-settings-daemon/gnome-settings-session.c -@@ -30,6 +30,7 @@ - #include "gnome-settings-session.h" - - #ifdef HAVE_SYSTEMD -+#include <systemd/sd-daemon.h> - #include <systemd/sd-login.h> - - typedef struct -@@ -130,10 +131,9 @@ struct GnomeSettingsSessionPrivate - { - #ifdef HAVE_SYSTEMD - GSource *sd_source; --#else -+#endif - GDBusProxy *proxy_session; - GCancellable *cancellable; --#endif - gchar *session_id; - GnomeSettingsSessionState state; - }; -@@ -237,7 +237,7 @@ sessions_changed (gpointer user_data) - return TRUE; - } - --#else /* HAVE_SYSTEMD */ -+#endif /* HAVE_SYSTEMD */ - - static void - gnome_settings_session_proxy_signal_cb (GDBusProxy *proxy, -@@ -371,22 +371,25 @@ got_manager_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_d - g_object_unref (proxy_manager); - } - --#endif /* HAVE_SYSTEMD */ -- - static void - gnome_settings_session_init (GnomeSettingsSession *session) - { - session->priv = GNOME_SETTINGS_SESSION_GET_PRIVATE (session); - - #ifdef HAVE_SYSTEMD -- sd_pid_get_session (getpid(), &session->priv->session_id); -+ session->priv->sd_source = NULL; -+ -+ if (sd_booted () > 0) { -+ sd_pid_get_session (getpid(), &session->priv->session_id); - -- session->priv->sd_source = sd_source_new (); -- g_source_set_callback (session->priv->sd_source, sessions_changed, session, NULL); -- g_source_attach (session->priv->sd_source, NULL); -+ session->priv->sd_source = sd_source_new (); -+ g_source_set_callback (session->priv->sd_source, sessions_changed, session, NULL); -+ g_source_attach (session->priv->sd_source, NULL); - -- sessions_changed (session); --#else -+ sessions_changed (session); -+ return; -+ } -+#endif - session->priv->cancellable = g_cancellable_new (); - - /* connect to ConsoleKit */ -@@ -399,7 +402,6 @@ gnome_settings_session_init (GnomeSettingsSession *session) - session->priv->cancellable, - got_manager_proxy_cb, - session); --#endif - } - - static void -@@ -415,15 +417,17 @@ gnome_settings_session_finalize (GObject *object) - if (session->priv->sd_source != NULL) { - g_source_destroy (session->priv->sd_source); - g_source_unref (session->priv->sd_source); -+ goto out; - } --#else -+#endif -+ - g_cancellable_cancel (session->priv->cancellable); - - if (session->priv->proxy_session != NULL) - g_object_unref (session->priv->proxy_session); - g_object_unref (session->priv->cancellable); --#endif - -+out: - G_OBJECT_CLASS (gnome_settings_session_parent_class)->finalize (object); - } - -diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c -index 8db04e5..9883d76 100644 ---- a/plugins/power/gsd-power-manager.c -+++ b/plugins/power/gsd-power-manager.c -@@ -2031,7 +2031,7 @@ systemd_stop (void) - g_object_unref (bus); - } - --#else -+#endif - - static void - consolekit_stop_cb (GObject *source_object, -@@ -2081,7 +2081,6 @@ consolekit_stop (void) - consolekit_stop_cb, NULL); - g_object_unref (proxy); - } --#endif - - static void - upower_sleep_cb (GObject *source_object, -@@ -2135,10 +2134,11 @@ do_power_action_type (GsdPowerManager *manager, - * hibernate is not available and is marginally better - * than just powering down the computer mid-write */ - #ifdef HAVE_SYSTEMD -- systemd_stop (); --#else -- consolekit_stop (); -+ if (sd_booted () > 0) -+ systemd_stop (); -+ else - #endif -+ consolekit_stop (); - break; - case GSD_POWER_ACTION_BLANK: - ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen, |