diff -Nru xfce4-power-manager-1.2.0/debian/changelog xfce4-power-manager-1.2.0/debian/changelog --- xfce4-power-manager-1.2.0/debian/changelog 2014-01-22 10:18:40.000000000 +0000 +++ xfce4-power-manager-1.2.0/debian/changelog 2014-04-07 15:09:14.000000000 +0000 @@ -1,3 +1,9 @@ +xfce4-power-manager (1.2.0-3ubuntu4) trusty; urgency=medium + + * Add 09_sync_session_xfpm_lock_setting.patch (LP: #1101982) + + -- Sean Davis Mon, 07 Apr 2014 10:09:14 -0500 + xfce4-power-manager (1.2.0-3ubuntu3) trusty; urgency=medium * Add 07_fix-screen-dimming.patch. LP: #1067749 diff -Nru xfce4-power-manager-1.2.0/debian/patches/09_sync_session_xfpm_lock_setting.patch xfce4-power-manager-1.2.0/debian/patches/09_sync_session_xfpm_lock_setting.patch --- xfce4-power-manager-1.2.0/debian/patches/09_sync_session_xfpm_lock_setting.patch 1970-01-01 00:00:00.000000000 +0000 +++ xfce4-power-manager-1.2.0/debian/patches/09_sync_session_xfpm_lock_setting.patch 2014-04-07 15:09:10.000000000 +0000 @@ -0,0 +1,126 @@ +Description: Sync the lock settings from xfce4-session and xfce4-power-manager + xfce4-session and xfce4-power-manager both have options to lock the screen + on suspend. However, these options are not synced and can lead to some + confusion for the user. This patch syncs these settings from the power + manager. + +Origin: other, https://github.com/EricKoegel/xfce4-power-manager/tree/be-friendly +Bug: https://bugzilla.xfce.org/show_bug.cgi?id=9030 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1101982 + +--- +--- a/settings/xfpm-settings.c ++++ b/settings/xfpm-settings.c +@@ -728,8 +728,14 @@ + void + lock_screen_toggled_cb (GtkWidget *w, XfconfChannel *channel) + { ++ XfconfChannel *session_channel = xfconf_channel_get ("xfce4-session"); + gboolean val = (gint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w)); +- ++ ++ if ( !xfconf_channel_set_bool (session_channel, "/shutdown/LockScreen", val) ) ++ { ++ g_critical ("Unable to set value for property %s\n", LOCK_SCREEN_ON_SLEEP); ++ } ++ + if ( !xfconf_channel_set_bool (channel, PROPERTIES_PREFIX LOCK_SCREEN_ON_SLEEP, val) ) + { + g_critical ("Unable to set value for property %s\n", LOCK_SCREEN_ON_SLEEP); +--- a/src/xfpm-xfconf.c ++++ b/src/xfpm-xfconf.c +@@ -44,6 +44,7 @@ + struct XfpmXfconfPrivate + { + XfconfChannel *channel; ++ XfconfChannel *session_channel; + GValue *values; + }; + +@@ -180,12 +181,37 @@ + if ( !g_str_has_prefix (property, PROPERTIES_PREFIX) || strlen (property) <= strlen (PROPERTIES_PREFIX) ) + return; + +- XFPM_DEBUG("Property modified: %s\n", property); ++ XFPM_DEBUG ("Property modified: %s\n", property); + + g_object_set_property (G_OBJECT (conf), property + strlen (PROPERTIES_PREFIX), value); + } + + static void ++xfpm_xfsession_property_changed_cb (XfconfChannel *channel, gchar *property, ++ GValue *value, XfpmXfconf *conf) ++{ ++ /*FIXME: Set default for this key*/ ++ if ( G_VALUE_TYPE(value) == G_TYPE_INVALID ) ++ return; ++ ++ XFPM_DEBUG ("property %s\n", property); ++ ++ if ( g_strcmp0 (property, "/shutdown/LockScreen") != 0) ++ return; ++ ++ /* sanity check */ ++ if ( !G_VALUE_HOLDS (value, G_TYPE_BOOLEAN) ) ++ return; ++ ++ XFPM_DEBUG ("Property modified: %s\n", property); ++ ++ /* update xfconf which will update xfpm and keep things in sync */ ++ xfconf_channel_set_bool (conf->priv->channel, ++ PROPERTIES_PREFIX LOCK_SCREEN_ON_SLEEP, ++ g_value_get_boolean(value)); ++} ++ ++static void + xfpm_xfconf_class_init (XfpmXfconfClass *klass) + { + GObjectClass *object_class = G_OBJECT_CLASS(klass); +@@ -543,6 +569,7 @@ + { + GError *error = NULL; + gboolean channel_valid; ++ gboolean lock_screen; + + conf->priv = XFPM_XFCONF_GET_PRIVATE (conf); + +@@ -557,9 +584,27 @@ + else + { + conf->priv->channel = xfconf_channel_new ("xfce4-power-manager"); ++ conf->priv->session_channel = xfconf_channel_new ("xfce4-session"); ++ ++ /* if xfce4-session is around, sync to it on startup */ ++ if ( xfconf_channel_has_property (conf->priv->session_channel, "/shutdown/LockScreen") ) ++ { ++ lock_screen = xfconf_channel_get_bool (conf->priv->session_channel, ++ "/shutdown/LockScreen", ++ TRUE); ++ ++ XFPM_DEBUG("lock screen %s", lock_screen ? "TRUE" : "FALSE"); ++ ++ g_object_set (G_OBJECT (conf), LOCK_SCREEN_ON_SLEEP, lock_screen, NULL); ++ } + + g_signal_connect (conf->priv->channel, "property-changed", + G_CALLBACK (xfpm_xfconf_property_changed_cb), conf); ++ ++ /* watch for session's property change so we can stay in sync */ ++ g_signal_connect (conf->priv->session_channel, "property-changed", ++ G_CALLBACK (xfpm_xfsession_property_changed_cb), conf); ++ + channel_valid = TRUE; + } + xfpm_xfconf_load (conf, channel_valid); +@@ -583,7 +628,10 @@ + + if (conf->priv->channel ) + g_object_unref (conf->priv->channel); +- ++ ++ if (conf->priv->session_channel ) ++ g_object_unref (conf->priv->session_channel); ++ + G_OBJECT_CLASS(xfpm_xfconf_parent_class)->finalize(object); + } + diff -Nru xfce4-power-manager-1.2.0/debian/patches/series xfce4-power-manager-1.2.0/debian/patches/series --- xfce4-power-manager-1.2.0/debian/patches/series 2014-01-22 10:18:40.000000000 +0000 +++ xfce4-power-manager-1.2.0/debian/patches/series 2014-04-07 15:09:10.000000000 +0000 @@ -7,3 +7,4 @@ 06_fix-suspend-auth-check.patch 07_fix-screen-dimming.patch 08_show_preferences_lxde.patch +09_sync_session_xfpm_lock_setting.patch