2011-12-14 14:22:56 +01:00
|
|
|
Index: xfce4-session-4.8.2/xfce4-session/xfsm-shutdown-helper.c
|
|
|
|
===================================================================
|
|
|
|
--- xfce4-session-4.8.2.orig/xfce4-session/xfsm-shutdown-helper.c
|
|
|
|
+++ xfce4-session-4.8.2/xfce4-session/xfsm-shutdown-helper.c
|
2011-12-15 17:22:20 +01:00
|
|
|
@@ -71,6 +71,8 @@
|
|
|
|
|
|
|
|
#include <libxfce4util/libxfce4util.h>
|
|
|
|
|
|
|
|
+#include <xfconf/xfconf.h>
|
|
|
|
+
|
|
|
|
#include "xfsm-shutdown-helper.h"
|
|
|
|
#include "xfsm-global.h"
|
|
|
|
|
|
|
|
@@ -1722,6 +1724,24 @@ gboolean xfsm_shutdown_helper_send_passw
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+lock_screen (void)
|
|
|
|
+{
|
|
|
|
+ XfconfChannel *channel;
|
2011-12-14 14:22:56 +01:00
|
|
|
+ gboolean ret;
|
2011-12-15 17:22:20 +01:00
|
|
|
+ gint exit_status;
|
|
|
|
+
|
|
|
|
+ channel = xfconf_channel_get ("xfce4-power-manager");
|
|
|
|
+ if (xfconf_channel_get_bool (channel, "/xfce4-power-manager/lock-screen-suspend-hibernate", TRUE))
|
|
|
|
+ {
|
|
|
|
+ ret = g_spawn_command_line_sync ("xflock4", NULL, NULL, &exit_status, NULL);
|
|
|
|
+ if (!ret || exit_status != 0)
|
|
|
|
+ {
|
|
|
|
+ g_warning ("Could not lock screen");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* xfsm_shutdown_helper_shutdown:
|
|
|
|
*
|
|
|
|
@@ -1785,6 +1805,8 @@ gboolean xfsm_shutdown_helper_suspend (X
|
|
|
|
{
|
2011-12-14 14:22:56 +01:00
|
|
|
g_return_val_if_fail (!error || !*error, FALSE);
|
|
|
|
|
2011-12-15 17:22:20 +01:00
|
|
|
+ lock_screen ();
|
2011-12-14 14:22:56 +01:00
|
|
|
+
|
|
|
|
#ifdef ENABLE_UPOWER
|
|
|
|
if ( helper->sleep_backend == XFSM_SLEEP_BACKEND_UPOWER )
|
|
|
|
{
|
2011-12-15 17:22:20 +01:00
|
|
|
@@ -1812,6 +1834,8 @@ gboolean xfsm_shutdown_helper_hibernate
|
2011-12-14 14:22:56 +01:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (!error || !*error, FALSE);
|
|
|
|
|
2011-12-15 17:22:20 +01:00
|
|
|
+ lock_screen ();
|
2011-12-14 14:22:56 +01:00
|
|
|
+
|
|
|
|
#ifdef ENABLE_UPOWER
|
|
|
|
if ( helper->sleep_backend == XFSM_SLEEP_BACKEND_UPOWER )
|
|
|
|
{
|