From cc1597e0ed7ac662f2291325e7ecd5f87632aff3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 10 Mar 2025 14:22:16 -0400 Subject: [PATCH] Hide emoji chooser unless explicitly requested Resolves: RHEL-65308 --- gtk4-no-emoji-context-menu.patch | 24 ++++++++++++++++++++++++ gtk4.spec | 1 + 2 files changed, 25 insertions(+) create mode 100644 gtk4-no-emoji-context-menu.patch diff --git a/gtk4-no-emoji-context-menu.patch b/gtk4-no-emoji-context-menu.patch new file mode 100644 index 0000000..5be916f --- /dev/null +++ b/gtk4-no-emoji-context-menu.patch @@ -0,0 +1,24 @@ +diff -up gtk-4.16.7/gtk/gtktext.c.no-emoji-context-menu gtk-4.16.7/gtk/gtktext.c +--- gtk-4.16.7/gtk/gtktext.c.no-emoji-context-menu 2025-03-10 14:20:33.230216455 -0400 ++++ gtk-4.16.7/gtk/gtktext.c 2025-03-10 14:20:46.104333590 -0400 +@@ -6304,7 +6304,7 @@ gtk_text_update_emoji_action (GtkText *s + + gtk_widget_action_set_enabled (GTK_WIDGET (self), "misc.insert-emoji", + priv->editable && +- (gtk_text_get_input_hints (self) & GTK_INPUT_HINT_NO_EMOJI) == 0); ++ (gtk_text_get_input_hints (self) & GTK_INPUT_HINT_EMOJI) != 0); + } + + static GMenuModel * +diff -up gtk-4.16.7/gtk/gtktextview.c.no-emoji-context-menu gtk-4.16.7/gtk/gtktextview.c +--- gtk-4.16.7/gtk/gtktextview.c.no-emoji-context-menu 2025-03-10 14:19:58.237898072 -0400 ++++ gtk-4.16.7/gtk/gtktextview.c 2025-03-10 14:20:19.298344903 -0400 +@@ -9205,7 +9205,7 @@ static void + gtk_text_view_update_emoji_action (GtkTextView *text_view) + { + gtk_widget_action_set_enabled (GTK_WIDGET (text_view), "misc.insert-emoji", +- (gtk_text_view_get_input_hints (text_view) & GTK_INPUT_HINT_NO_EMOJI) == 0 && ++ (gtk_text_view_get_input_hints (text_view) & GTK_INPUT_HINT_EMOJI) != 0 && + text_view->priv->editable); + } + diff --git a/gtk4.spec b/gtk4.spec index c96f284..6c9ce4d 100644 --- a/gtk4.spec +++ b/gtk4.spec @@ -34,6 +34,7 @@ Source0: https://download.gnome.org/sources/gtk/4.15/gtk-%{version}.tar.x # Using objcopy for resources interferes with hardening Patch0: gtk4-no-objcopy.patch +Patch1: gtk4-no-emoji-context-menu.patch BuildRequires: cups-devel BuildRequires: desktop-file-utils