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

noreply at xfce.org noreply at xfce.org
Sun Feb 26 16:34:12 CET 2017


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 a1786406931d01499719f1aec344b6a3631399a6
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 d031bb1..23fa3ce 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -914,10 +914,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);
@@ -928,26 +930,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