mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 02:20:43 -05:00
x11/window-props: Convert WM_NAME and WM_CLASS to UTF-8
gjs throws exceptions on non UTF-8 strings which, in some cases, crash gnome-shell. ICCCM string properties are defined to be Latin-1 encoded so we can try to convert them to avoid it. Note that _NET_WM_NAME is defined to be UTF-8 and we already validate it in utf8_string_from_results() . https://bugzilla.gnome.org/show_bug.cgi?id=752788
This commit is contained in:
parent
0b4cd7ed92
commit
a15f33ac9c
@ -635,7 +635,10 @@ reload_wm_name (MetaWindow *window,
|
||||
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
{
|
||||
set_window_title (window, value->v.str);
|
||||
g_autofree gchar *title = g_convert (value->v.str, -1,
|
||||
"UTF-8", "LATIN1",
|
||||
NULL, NULL, NULL);
|
||||
set_window_title (window, title);
|
||||
|
||||
meta_verbose ("Using WM_NAME for new title of %s: \"%s\"\n",
|
||||
window->desc, window->title);
|
||||
@ -969,9 +972,13 @@ reload_wm_class (MetaWindow *window,
|
||||
{
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
{
|
||||
meta_window_set_wm_class (window,
|
||||
value->v.class_hint.res_class,
|
||||
value->v.class_hint.res_name);
|
||||
g_autofree gchar *res_class = g_convert (value->v.class_hint.res_class, -1,
|
||||
"UTF-8", "LATIN1",
|
||||
NULL, NULL, NULL);
|
||||
g_autofree gchar *res_name = g_convert (value->v.class_hint.res_name, -1,
|
||||
"UTF-8", "LATIN1",
|
||||
NULL, NULL, NULL);
|
||||
meta_window_set_wm_class (window, res_class, res_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user