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);
gchar *visible = NULL;
g_free(self->title);
+ g_free(self->original_title);
/* try netwm */
if (!PROP_GETS(self->window, net_wm_name, utf8, &data)) {
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);
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)
#include "client.h"
#include "prop.h"
#include "modkeys.h"
+#include "event.h"
#include "gettext.h"
static GList *prompt_list = NULL;
XSizeHints hints;
gint i;
- if (self->mapped) return;
+ if (self->mapped) {
+ /* activate the prompt */
+ PROP_MSG(self->super.window, net_active_window,
+ 1, /* from an application.. */
+ event_curtime,
+ 0,
+ 0);
+ return;
+ }
/* set the focused button (if not found then the first button is used) */
self->focus = &self->button[0];
ObPromptElement *but;
if (e->type != ButtonPress && e->type != ButtonRelease &&
- e->type != MotionNotify) return;
+ e->type != MotionNotify) return FALSE;
/* find the button */
but = NULL;