mirror of
https://github.com/brl/mutter.git
synced 2025-01-11 04:02:36 +00:00
2008-06-24 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-entry.c: (clutter_entry_ensure_layout): Convert the invisible char to UTF-8 to avoid Pango barfing on us.
This commit is contained in:
parent
a692421945
commit
9bc15bb467
@ -1,3 +1,9 @@
|
|||||||
|
2008-06-24 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* 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 <mallum@openedhand.com>
|
2008-06-24 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
* clutter/eglnative/clutter-stage-egl.c:
|
* clutter/eglnative/clutter-stage-egl.c:
|
||||||
|
@ -277,17 +277,25 @@ clutter_entry_ensure_layout (ClutterEntry *entry, gint width)
|
|||||||
{
|
{
|
||||||
GString *str = g_string_sized_new (priv->n_bytes);
|
GString *str = g_string_sized_new (priv->n_bytes);
|
||||||
gunichar invisible_char;
|
gunichar invisible_char;
|
||||||
gint i;
|
gchar buf[7];
|
||||||
|
gint char_len, i;
|
||||||
|
|
||||||
if (priv->priv_char != 0)
|
if (priv->priv_char != 0)
|
||||||
invisible_char = priv->priv_char;
|
invisible_char = priv->priv_char;
|
||||||
else
|
else
|
||||||
invisible_char = '*';
|
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++)
|
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);
|
pango_layout_set_text (priv->layout, str->str, str->len);
|
||||||
|
|
||||||
g_string_free (str, TRUE);
|
g_string_free (str, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user