the #ifdef was backwards for using SM or not
[dana/openbox.git] / openbox / actions / session.c
index 0031a27..fc66d25 100644 (file)
@@ -3,10 +3,6 @@
 #include "openbox/session.h"
 #include "gettext.h"
 
-#ifndef USE_SM
-void action_logout_startup(void) {}
-#else
-
 typedef struct {
     gboolean prompt;
     gboolean silent;
@@ -27,6 +23,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
     Options *o;
 
     o = g_new0(Options, 1);
+    o->prompt = TRUE;
 
     if ((n = parse_find_node("prompt", node)))
         o->prompt = parse_bool(doc, n);
@@ -37,8 +34,13 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
 static void prompt_cb(ObPrompt *p, gint result, gpointer data)
 {
     Options *o = data;
-    if (result)
+    if (result) {
+#ifdef USE_SM
         session_request_logout(o->silent);
+#else
+        g_message(_("The SessionLogout actions is not available since Openbox was built without session management support"));
+#endif
+    }
     g_free(o);
     prompt_unref(p);
 }
@@ -66,5 +68,3 @@ static gboolean logout_func(ObActionsData *data, gpointer options)
 
     return FALSE;
 }
-
-#endif