summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-02-07 01:03:05 -0500
committerDana Jansens <danakj@orodu.net>2008-02-14 14:24:36 -0500
commit972e1fc5a32e7d798fb3023012e73af20b5b03c7 (patch)
tree508ec1d9c0f3a8d2ba48c9d4303e6388f6124a49 /openbox/client.c
parentd714bb5708bb8b99d71803404af7af01029c5553 (diff)
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
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 98ad7de2..44e027f8 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -820,6 +820,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);
@@ -1974,6 +1975,7 @@ void client_update_title(ObClient *self)
gchar *visible = NULL;
g_free(self->title);
+ g_free(self->original_title);
/* try netwm */
if (!PROP_GETS(self->window, net_wm_name, utf8, &data)) {
@@ -1990,6 +1992,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);
@@ -3398,26 +3401,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;
+ 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->title);
+ 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);
- prompt_show(self->kill_prompt, self);
+ 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);
+ }
- g_free(m);
+ prompt_show(self->kill_prompt, self);
}
void client_kill(ObClient *self)