diff --git a/ChangeLog b/ChangeLog index fbb1a0a99..33c5a20cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,15 @@ +2008-06-24 Emmanuele Bassi + + * clutter/clutter-entry.c: + (clutter_entry_ensure_layout): Convert the invisible char + to UTF-8 to avoid Pango barfing on us. + 2008-06-24 Matthew Allum * clutter/eglnative/clutter-stage-egl.c: - Add an extra debug note. + Add an extra debug note. * configure.ac: - Generate version.xml for COGL API docs + Generate version.xml for COGL API docs 2008-06-24 Chris Lord @@ -28,17 +34,17 @@ 2008-06-23 Matthew Allum * NEWS: - Add a quick note on fruity multiple deivce support. + Add a quick note on fruity multiple deivce support. * README: - Add multiple device support details and some tweaks on - Clutter requirements (i.e GdkPixbuf). + Add multiple device support details and some tweaks on + Clutter requirements (i.e GdkPixbuf). 2008-06-23 Matthew Allum - Bug 987 - clutter-event.c c99 variable declaration + Bug 987 - clutter-event.c c99 variable declaration * clutter/clutter-event.c: - Remove c99ism. + Remove c99ism. 2008-06-23 Emmanuele Bassi diff --git a/clutter/clutter-entry.c b/clutter/clutter-entry.c index 76597a8b4..d5a70b0ed 100644 --- a/clutter/clutter-entry.c +++ b/clutter/clutter-entry.c @@ -277,17 +277,25 @@ clutter_entry_ensure_layout (ClutterEntry *entry, gint width) { GString *str = g_string_sized_new (priv->n_bytes); gunichar invisible_char; - gint i; + gchar buf[7]; + gint char_len, i; if (priv->priv_char != 0) invisible_char = priv->priv_char; else invisible_char = '*'; + /* we need to convert the string built of invisible characters + * into UTF-8 for it to be fed to the Pango layout + */ + memset (buf, 0, sizeof (buf)); + char_len = g_unichar_to_utf8 (invisible_char, buf); + for (i = 0; i < priv->n_chars; i++) - g_string_append_unichar (str, invisible_char); + g_string_append_len (str, buf, char_len); pango_layout_set_text (priv->layout, str->str, str->len); + g_string_free (str, TRUE); }