diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-07-19 17:57:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-07-19 20:51:22 -0400 |
commit | 078870f604d58352f38eb55d453642a0978ad0af (patch) | |
tree | 871dacf0382346380cb008af0eb318f0296a49a0 | |
parent | c52d9cfc14009b1821f99e2c9b30534ae164914f (diff) | |
download | gtk+-078870f604d58352f38eb55d453642a0978ad0af.tar.gz |
Emoji chooser: Also check for hex boxes
We don't want to see those either.
-rw-r--r-- | gtk/gtkemojichooser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 68cabda67e..ee17ea3cf1 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -404,7 +404,8 @@ add_emoji (GtkWidget *box, pango_layout_get_extents (layout, &rect, NULL); /* Check for fallback rendering that generates too wide items */ - if (rect.width >= 1.5 * chooser->emoji_max_width) + if (pango_layout_get_unknown_glyphs_count (layout) > 0 || + rect.width >= 1.5 * chooser->emoji_max_width) { gtk_widget_destroy (label); return; @@ -654,7 +655,8 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser) /* Get a reasonable maximum width for an emoji. We do this to * skip overly wide fallback rendering for certain emojis the * font does not contain and therefore end up being rendered - * as multiply glyphs. */ + * as multiply glyphs. + */ { PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (chooser), "🙂"); PangoAttrList *attrs; |