[Xfce4-commits] <xfce4-session:master> Make the buttons sensitive when using sudo (bug #8708).

Nick Schermer noreply at xfce.org
Tue Apr 17 21:26:01 CEST 2012


Updating branch refs/heads/master
         to 732f0b58026738c23bef3121668bbdd695e09fb1 (commit)
       from 27058a6b679233d6921dab44ee70bb9638a15f24 (commit)

commit 732f0b58026738c23bef3121668bbdd695e09fb1
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Apr 17 21:24:27 2012 +0200

    Make the buttons sensitive when using sudo (bug #8708).

 xfce4-session/xfsm-shutdown.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xfce4-session/xfsm-shutdown.c b/xfce4-session/xfsm-shutdown.c
index b55dc27..30021af 100644
--- a/xfce4-session/xfsm-shutdown.c
+++ b/xfce4-session/xfsm-shutdown.c
@@ -701,7 +701,13 @@ xfsm_shutdown_can_restart (XfsmShutdown  *shutdown,
   if (xfsm_consolekit_can_restart (shutdown->consolekit, can_restart, error))
     return TRUE;
 
-  return xfsm_shutdown_sudo_init (shutdown, error);
+  if (xfsm_shutdown_sudo_init (shutdown, error))
+    {
+      *can_restart = TRUE;
+      return TRUE;
+    }
+
+  return FALSE;
 }
 
 
@@ -722,7 +728,13 @@ xfsm_shutdown_can_shutdown (XfsmShutdown  *shutdown,
   if (xfsm_consolekit_can_shutdown (shutdown->consolekit, can_shutdown, error))
     return TRUE;
 
-  return xfsm_shutdown_sudo_init (shutdown, error);
+  if (xfsm_shutdown_sudo_init (shutdown, error))
+    {
+      *can_shutdown = TRUE;
+      return TRUE;
+    }
+
+  return FALSE;
 }
 
 


More information about the Xfce4-commits mailing list