[gtk/carlosgc/no-emoji-hint] emojichooser: never show emoji chooser when input hint no-emoji is present
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/carlosgc/no-emoji-hint] emojichooser: never show emoji chooser when input hint no-emoji is present
- Date: Mon, 30 Dec 2019 09:57:56 +0000 (UTC)
commit c6e5030c610b0a91ba9ac5b646d139e486d6ec00
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Mon Dec 30 10:39:42 2019 +0100
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.
gtk/gtkentry.c | 3 +++
gtk/gtktextview.c | 3 +++
2 files changed, 6 insertions(+)
---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]