]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/execute.c
add a cleanup callback to the prompt interface. when the prompt's callback returns...
[chaz/openbox] / openbox / actions / execute.c
index f87fe00c6ea8317750c22be9589828545a8c3c10..636dbebf3e3bd0f709d1dec6c652ffcc79b7665f 100644 (file)
@@ -98,11 +98,15 @@ static Options* dup_options(Options *in)
 
 static gboolean run_func(ObActionsData *data, gpointer options);
 
-static void prompt_cb(ObPrompt *p, gint result, gpointer options)
+static gboolean prompt_cb(ObPrompt *p, gint result, gpointer options)
 {
     if (result)
         run_func(NULL, options);
+    return TRUE; /* call the cleanup func */
+}
 
+static void prompt_cleanup(ObPrompt *p, gpointer options)
+{
     prompt_unref(p);
     free_func(options);
 }
@@ -126,7 +130,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         };
 
         ocp = dup_options(options);
-        p = prompt_new(o->prompt, answers, 2, 0, 0, prompt_cb, ocp);
+        p = prompt_new(o->prompt, answers, 2, 0, 0,
+                       prompt_cb, prompt_cleanup, ocp);
         prompt_show(p, NULL, FALSE);
 
         return FALSE;
This page took 0.020272 seconds and 4 git commands to generate.