[Xfce4-commits] [xfce/xfce4-panel] 01/01: Panel action button Logout always save session (bug #7930)

noreply at xfce.org noreply at xfce.org
Wed Nov 19 10:38:02 CET 2014


This is an automated email from the git hooks/post-receive script.

andrzejr pushed a commit to branch master
in repository xfce/xfce4-panel.

commit 3848b0c0df4c2d744e4a9db2653c0507f78fbba3
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Wed Nov 19 09:37:54 2014 +0000

    Panel action button Logout always save session (bug #7930)
---
 plugins/actions/actions.c |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c
index 4a5dde4..1c76c48 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -911,10 +911,12 @@ static void
 actions_plugin_action_activate (GtkWidget      *widget,
                                 ActionsPlugin  *plugin)
 {
-  ActionEntry *entry;
-  gboolean     unattended = FALSE;
-  GError      *error = NULL;
-  gboolean     succeed = FALSE;
+  ActionEntry   *entry;
+  gboolean       unattended = FALSE;
+  GError        *error = NULL;
+  gboolean       succeed = FALSE;
+  XfconfChannel *channel;
+  gboolean       allow_save;
 
   entry = g_object_get_qdata (G_OBJECT (widget), action_quark);
   panel_return_if_fail (entry != NULL);
@@ -925,26 +927,29 @@ actions_plugin_action_activate (GtkWidget      *widget,
       && !actions_plugin_action_confirmation (plugin, entry, &unattended))
     return;
 
+  channel = xfconf_channel_get ("xfce4-session");
+  allow_save = xfconf_channel_get_bool (channel, "/general/SaveOnExit", FALSE);
+
   switch (entry->type)
     {
     case ACTION_TYPE_LOGOUT:
       succeed = actions_plugin_action_dbus_xfsm ("Logout", FALSE,
-                                                 !unattended, &error);
+                                                 allow_save, &error);
       break;
 
     case ACTION_TYPE_LOGOUT_DIALOG:
       succeed = actions_plugin_action_dbus_xfsm ("Logout", TRUE,
-                                                 !unattended, &error);
+                                                 allow_save, &error);
       break;
 
     case ACTION_TYPE_RESTART:
       succeed = actions_plugin_action_dbus_xfsm ("Restart", FALSE,
-                                                 !unattended, &error);
+                                                 allow_save, &error);
       break;
 
     case ACTION_TYPE_SHUTDOWN:
       succeed = actions_plugin_action_dbus_xfsm ("Shutdown", FALSE,
-                                                 !unattended, &error);
+                                                 allow_save, &error);
       break;
 
     case ACTION_TYPE_HIBERNATE:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list