From 7ecfa01df81fcce628fbb354cc0c4faaddfb5c84 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 7 Feb 2008 01:03:05 -0500 Subject: if a prompt is already showing and you try show it again, then make it active. in the "kill this?" prompt use the window's original title without any of the openbox-appended-ness --- openbox/client.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index d088fca6..c9da5e6d 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -737,6 +737,7 @@ void client_unmanage(ObClient *self) g_free(self->wm_command); g_free(self->title); g_free(self->icon_title); + g_free(self->original_title); g_free(self->name); g_free(self->class); g_free(self->role); @@ -1892,6 +1893,7 @@ void client_update_title(ObClient *self) gchar *visible = NULL; g_free(self->title); + g_free(self->original_title); /* try netwm */ if (!OBT_PROP_GETS(self->window, NET_WM_NAME, utf8, &data)) { @@ -1908,6 +1910,7 @@ void client_update_title(ObClient *self) data = g_strdup("Unnamed Window"); } } + self->original_title = g_strdup(data); if (self->client_machine) { visible = g_strdup_printf("%s (%s)", data, self->client_machine); @@ -3306,26 +3309,26 @@ static void client_kill_requested(ObPrompt *p, gint result, gpointer data) static void client_prompt_kill(ObClient *self) { - ObPromptAnswer answers[] = { - { _("No"), OB_KILL_RESULT_NO }, - { _("Yes"), OB_KILL_RESULT_YES } - }; - gchar *m; - /* check if we're already prompting */ - if (self->kill_prompt) return; - - m = g_strdup_printf - (_("The window \"%s\" does not seem to be responding. Do you want to force it to exit?"), self->title); + if (!self->kill_prompt) { + ObPromptAnswer answers[] = { + { _("No"), OB_KILL_RESULT_NO }, + { _("Yes"), OB_KILL_RESULT_YES } + }; + gchar *m; + + m = g_strdup_printf + (_("The window \"%s\" does not seem to be responding. Do you want to force it to exit?"), self->original_title); + + self->kill_prompt = prompt_new(m, answers, + sizeof(answers)/sizeof(answers[0]), + OB_KILL_RESULT_NO, /* default = no */ + OB_KILL_RESULT_NO, /* cancel = no */ + client_kill_requested, self); + g_free(m); + } - self->kill_prompt = prompt_new(m, answers, - sizeof(answers)/sizeof(answers[0]), - OB_KILL_RESULT_NO, /* default = no */ - OB_KILL_RESULT_NO, /* cancel = no */ - client_kill_requested, self); prompt_show(self->kill_prompt, self); - - g_free(m); } void client_kill(ObClient *self) -- cgit v1.2.3