X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=e9443d4914e256ac5647e7ef2dafd261c7ca13b8;hb=7fb107cd37a09787c5cfa590688944b3bcb2bab8;hp=b57d61691bd57120e10cf67cf4a41cfe68b03bbf;hpb=ac255432b46617fe01fd40fd02fdea878893ce3c;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index b57d6169..e9443d49 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3339,12 +3339,20 @@ void client_close(ObClient *self) #define OB_KILL_RESULT_NO 0 #define OB_KILL_RESULT_YES 1 -static void client_kill_requested(ObPrompt *p, gint result, gpointer data) +static gboolean client_kill_requested(ObPrompt *p, gint result, gpointer data) { ObClient *self = data; if (result == OB_KILL_RESULT_YES) client_kill(self); + return TRUE; /* call the cleanup func */ +} + +static void client_kill_cleanup(ObPrompt *p, gpointer data) +{ + ObClient *self = data; + + g_assert(p == self->kill_prompt); prompt_unref(self->kill_prompt); self->kill_prompt = NULL; @@ -3391,11 +3399,13 @@ static void client_prompt_kill(ObClient *self) answers[0].text = _("Cancel"); /* "no" */ answers[1].text = y; /* "yes" */ - self->kill_prompt = prompt_new(m, answers, + self->kill_prompt = prompt_new(m, NULL, answers, sizeof(answers)/sizeof(answers[0]), OB_KILL_RESULT_NO, /* default = no */ OB_KILL_RESULT_NO, /* cancel = no */ - client_kill_requested, self); + client_kill_requested, + client_kill_cleanup, + self); g_free(m); }