fix up handling of text properties, so we get UTF8_STRING as that type and

2001-09-11  Havoc Pennington  <hp@pobox.com>

	* src/window.c: fix up handling of text properties, so we
	get UTF8_STRING as that type and not as text list, and so
	we properly convert from text list to UTF-8
This commit is contained in:
Havoc Pennington
2001-09-11 04:37:10 +00:00
committed by Havoc Pennington
parent 3645fef5e0
commit 9f66f63bf5
4 changed files with 146 additions and 99 deletions

View File

@@ -445,3 +445,30 @@ meta_ui_window_should_not_cause_focus (Display *xdisplay,
else
return FALSE;
}
char*
meta_text_property_to_utf8 (Display *xdisplay,
const XTextProperty *prop)
{
char **list;
int count;
char *retval;
list = NULL;
count = gdk_text_property_to_utf8_list (prop->encoding,
prop->format,
prop->value,
prop->nitems,
&list);
if (count == 0)
return NULL;
retval = list[0];
list[0] = g_strdup (""); /* something to free */
g_strfreev (list);
return retval;
}