From a89ceecb1d9059283076d4557686db6d0230aab5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 20 Feb 2009 11:26:25 +0100 Subject: [PATCH] xutil: handle COMPOUND_TEXT blindly Signed-off-by: Julien Danjou --- common/atoms.list | 1 + common/xutil.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/atoms.list b/common/atoms.list index 12c13e833..191f4a2cc 100644 --- a/common/atoms.list +++ b/common/atoms.list @@ -44,6 +44,7 @@ _NET_WM_STATE_MODAL _NET_WM_STATE_HIDDEN _NET_WM_STATE_DEMANDS_ATTENTION UTF8_STRING +COMPOUND_TEXT _AWESOME_FLOATING _AWESOME_FULLSCREEN _AWESOME_TAGS diff --git a/common/xutil.c b/common/xutil.c index 4d947ebb6..4d46b6db0 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -58,9 +58,11 @@ xutil_text_prop_get(xcb_connection_t *conn, xcb_window_t w, xcb_atom_t atom, if(text && len) { /* Check whether the returned property value is just an ascii - * string or utf8 string. At the moment it doesn't handle - * COMPOUND_TEXT and multibyte but it's not needed... */ - if(reply.encoding == STRING || reply.encoding == UTF8_STRING) + * string, an UTF-8 string or just some random multibyte in any other + * encoding. */ + if(reply.encoding == STRING + || reply.encoding == UTF8_STRING + || reply.encoding == COMPOUND_TEXT) { *text = p_new(char, reply.name_len + 1); /* Use memcpy() because the property name is not be \0