diff options
| author | Carlos Garcia Campos <cgarcia@igalia.com> | 2019-12-30 10:39:42 +0100 |
|---|---|---|
| committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2019-12-30 10:56:06 +0100 |
| commit | c6e5030c610b0a91ba9ac5b646d139e486d6ec00 (patch) | |
| tree | bfc88c6d8c6653607486b2e7aad94cf48df90958 | |
| parent | 1bc188b1f446999473f7a1e49219ab0727b7c4fe (diff) | |
| download | gtk+-c6e5030c610b0a91ba9ac5b646d139e486d6ec00.tar.gz | |
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.
| -rw-r--r-- | gtk/gtkentry.c | 3 | ||||
| -rw-r--r-- | gtk/gtktextview.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 297dd0fe63..db93ee1baa 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -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; diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 2a215309c4..408129bfef 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -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; |
