X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fexit.c;h=4f8cce6e6c44517bd50d88eeeced98de3002db7c;hb=a1746ab2158da2324aefb7ce81e7b5edc9c41e79;hp=58a1dcb19a6644c86323867f2206b7ef65bbc33c;hpb=163950b23bf796a39870044417ca54d667b6b470;p=chaz%2Fopenbox diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index 58a1dcb1..4f8cce6e 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -21,6 +21,7 @@ static gpointer setup_func(xmlNodePtr node) Options *o; o = g_new0(Options, 1); + o->prompt = TRUE; if ((n = obt_parse_find_node(node, "prompt"))) o->prompt = obt_parse_node_bool(n); @@ -28,10 +29,15 @@ static gpointer setup_func(xmlNodePtr node) return o; } -static void prompt_cb(ObPrompt *p, gint result, gpointer data) +static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data) { if (result) ob_exit(0); + return TRUE; /* call the cleanup func */ +} + +static void prompt_cleanup(ObPrompt *p, gpointer data) +{ prompt_unref(p); } @@ -48,7 +54,8 @@ static gboolean run_func(ObActionsData *data, gpointer options) }; p = prompt_new(_("Are you sure you want to exit Openbox?"), - answers, 2, 0, 0, prompt_cb, NULL); + _("Exit Openbox"), + answers, 2, 0, 0, prompt_cb, prompt_cleanup, NULL); prompt_show(p, NULL, FALSE); } else