mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
Fix crash with non-responding application with no title
If a window had no title property set, then the application-not-responding dialog would cause Mutter to crash because window->title was NULL; handle that case and use the string "Application is not responding." https://bugzilla.gnome.org/show_bug.cgi?id=649114
This commit is contained in:
parent
60dd31ed48
commit
89dbef9eb3
@ -88,19 +88,31 @@ delete_ping_timeout_func (MetaDisplay *display,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is to get a bit better string if the title isn't representable
|
/* This is to get a better string if the title isn't representable
|
||||||
* in the locale encoding; actual conversion to UTF-8 is done inside
|
* in the locale encoding; actual conversion to UTF-8 is done inside
|
||||||
* meta_show_dialog */
|
* meta_show_dialog */
|
||||||
tmp = g_locale_from_utf8 (window->title, -1, NULL, NULL, NULL);
|
|
||||||
if (tmp == NULL)
|
if (window->title && window->title[0])
|
||||||
window_title = "???";
|
{
|
||||||
|
tmp = g_locale_from_utf8 (window->title, -1, NULL, NULL, NULL);
|
||||||
|
if (tmp == NULL)
|
||||||
|
window_title = NULL;
|
||||||
|
else
|
||||||
|
window_title = window->title;
|
||||||
|
g_free (tmp);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
window_title = window->title;
|
{
|
||||||
g_free (tmp);
|
window_title = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Translators: %s is a window title */
|
/* Translators: %s is a window title */
|
||||||
tmp = g_markup_printf_escaped (_("<tt>%s</tt> is not responding."),
|
if (window_title)
|
||||||
window_title);
|
tmp = g_markup_printf_escaped (_("<tt>%s</tt> is not responding."),
|
||||||
|
window_title);
|
||||||
|
else
|
||||||
|
tmp = g_strdup (_("Application is not responding."));
|
||||||
|
|
||||||
window_content = g_strdup_printf (
|
window_content = g_strdup_printf (
|
||||||
"<big><b>%s</b></big>\n\n<i>%s</i>",
|
"<big><b>%s</b></big>\n\n<i>%s</i>",
|
||||||
tmp,
|
tmp,
|
||||||
|
Loading…
Reference in New Issue
Block a user