From 03193df6cad651841e8d9960335b4a3bf13afdad Mon Sep 17 00:00:00 2001
From: Yves-Alexis Perez <corsac@debian.org>
Date: Wed, 3 Sep 2014 15:44:06 +0200
Subject: [PATCH] Fix logic of xfconf logind inhibition keys

---
 src/xfpm-manager.c | 18 +++++++++---------
 src/xfpm-xfconf.c  |  8 ++++----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/xfpm-manager.c b/src/xfpm-manager.c
index a7417a57..d6c533c8 100644
--- a/src/xfpm-manager.c
+++ b/src/xfpm-manager.c
@@ -504,22 +504,22 @@ xfpm_manager_get_systemd_events(XfpmManager *manager)
 {
     GSList *events = NULL;
     gchar *what = "";
-    gboolean handle_power_key, handle_suspend_key, handle_hibernate_key, handle_lid_switch;
+    gboolean logind_handle_power_key, logind_handle_suspend_key, logind_handle_hibernate_key, logind_handle_lid_switch;
 
     g_object_get (G_OBJECT (manager->priv->conf),
-        LOGIND_HANDLE_POWER_KEY, &handle_power_key,
-        LOGIND_HANDLE_SUSPEND_KEY, &handle_suspend_key,
-        LOGIND_HANDLE_HIBERNATE_KEY, &handle_hibernate_key,
-        LOGIND_HANDLE_LID_SWITCH, &handle_lid_switch,
+        LOGIND_HANDLE_POWER_KEY, &logind_handle_power_key,
+        LOGIND_HANDLE_SUSPEND_KEY, &logind_handle_suspend_key,
+        LOGIND_HANDLE_HIBERNATE_KEY, &logind_handle_hibernate_key,
+        LOGIND_HANDLE_LID_SWITCH, &logind_handle_lid_switch,
         NULL);
 
-    if (handle_power_key)
+    if (!logind_handle_power_key)
         events = g_slist_append(events, "handle-power-key");
-    if (handle_suspend_key)
+    if (!logind_handle_suspend_key)
         events = g_slist_append(events, "handle-suspend-key");
-    if (handle_hibernate_key)
+    if (!logind_handle_hibernate_key)
         events = g_slist_append(events, "handle-hibernate-key");
-    if (handle_lid_switch)
+    if (!logind_handle_lid_switch)
         events = g_slist_append(events, "handle-lid-switch");
 
     while (events != NULL)
diff --git a/src/xfpm-xfconf.c b/src/xfpm-xfconf.c
index 2603bc19..721d9777 100644
--- a/src/xfpm-xfconf.c
+++ b/src/xfpm-xfconf.c
@@ -563,7 +563,7 @@ xfpm_xfconf_class_init (XfpmXfconfClass *klass)
                                      PROP_LOGIND_HANDLE_POWER_KEY,
                                      g_param_spec_boolean (LOGIND_HANDLE_POWER_KEY,
                                                            NULL, NULL,
-                                                           TRUE,
+                                                           FALSE,
                                                            G_PARAM_READWRITE));
 
     /**
@@ -573,7 +573,7 @@ xfpm_xfconf_class_init (XfpmXfconfClass *klass)
                                      PROP_LOGIND_HANDLE_SUSPEND_KEY,
                                      g_param_spec_boolean (LOGIND_HANDLE_SUSPEND_KEY,
                                                            NULL, NULL,
-                                                           TRUE,
+                                                           FALSE,
                                                            G_PARAM_READWRITE));
 
     /**
@@ -583,7 +583,7 @@ xfpm_xfconf_class_init (XfpmXfconfClass *klass)
                                      PROP_LOGIND_HANDLE_HIBERNATE_KEY,
                                      g_param_spec_boolean (LOGIND_HANDLE_HIBERNATE_KEY,
                                                            NULL, NULL,
-                                                           TRUE,
+                                                           FALSE,
                                                            G_PARAM_READWRITE));
 
     /**
@@ -593,7 +593,7 @@ xfpm_xfconf_class_init (XfpmXfconfClass *klass)
                                      PROP_LOGIND_HANDLE_LID_SWITCH,
                                      g_param_spec_boolean (LOGIND_HANDLE_LID_SWITCH,
                                                            NULL, NULL,
-                                                           TRUE,
+                                                           FALSE,
                                                            G_PARAM_READWRITE));
 
     g_type_class_add_private (klass, sizeof (XfpmXfconfPrivate));
-- 
GitLab