mirror of
https://github.com/brl/mutter.git
synced 2025-08-04 23:54:40 +00:00
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:

committed by
Havoc Pennington

parent
3645fef5e0
commit
9f66f63bf5
27
src/ui.c
27
src/ui.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user