]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/session.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / actions / session.c
index 0117e07c97b06ab55baf3c9de6487139f6bfad83..b6eebcb6248b2273dedf8a26c340427ae60b36e9 100644 (file)
@@ -3,16 +3,12 @@
 #include "openbox/session.h"
 #include "gettext.h"
 
-#ifndef USE_SM
-void action_logout_startup(void) {}
-#else
-
 typedef struct {
     gboolean prompt;
     gboolean silent;
 } Options;
 
-static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
+static gpointer setup_func(xmlNodePtr node);
 static gboolean logout_func(ObActionsData *data, gpointer options);
 
 void action_session_startup(void)
@@ -21,7 +17,7 @@ void action_session_startup(void)
                      NULL, NULL);
 }
 
-static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
+static gpointer setup_func(xmlNodePtr node)
 {
     xmlNodePtr n;
     Options *o;
@@ -29,8 +25,8 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
     o = g_new0(Options, 1);
     o->prompt = TRUE;
 
-    if ((n = parse_find_node("prompt", node)))
-        o->prompt = parse_bool(doc, n);
+    if ((n = obt_parse_find_node(node, "prompt")))
+        o->prompt = obt_parse_node_bool(n);
 
     return o;
 }
@@ -38,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) {
+#ifndef 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);
 }
@@ -67,5 +68,3 @@ static gboolean logout_func(ObActionsData *data, gpointer options)
 
     return FALSE;
 }
-
-#endif
This page took 0.02675 seconds and 4 git commands to generate.