emojichooser: never show emoji chooser when input hint no-emoji is present

It's currently used only to not include the insert emoji option in the
context menu, but it's still possible to show the emoji chooser in both
GtkEntry and GtkTextView using the key bindings.
See also https://bugs.webkit.org/show_bug.cgi?id=205609.
This commit is contained in:
Carlos Garcia Campos
2019-12-30 10:39:42 +01:00
committed by Carlos Garcia Campos
parent 1bc188b1f4
commit c6e5030c61
2 changed files with 6 additions and 0 deletions

View File

@@ -11093,6 +11093,9 @@ gtk_entry_insert_emoji (GtkEntry *entry)
GtkWidget *chooser;
GdkRectangle rect;
if (gtk_entry_get_input_hints (entry) & GTK_INPUT_HINT_NO_EMOJI)
return;
if (gtk_widget_get_ancestor (GTK_WIDGET (entry), GTK_TYPE_EMOJI_CHOOSER) != NULL)
return;

View File

@@ -11462,6 +11462,9 @@ gtk_text_view_insert_emoji (GtkTextView *text_view)
GdkRectangle rect;
GtkTextBuffer *buffer;
if (gtk_text_view_get_input_hints (text_view) & GTK_INPUT_HINT_NO_EMOJI)
return;
if (gtk_widget_get_ancestor (GTK_WIDGET (text_view), GTK_TYPE_EMOJI_CHOOSER) != NULL)
return;