From 472d7c466d33bd1fe4cd293b354e52bf16384520 Mon Sep 17 00:00:00 2001 From: Gordon Norman Squash Date: Tue, 10 Sep 2024 01:28:29 -0400 Subject: Initial commit This is where I have started tracking development with Git. I declare this as version 0.89. --- patches/no-emojis.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 patches/no-emojis.c (limited to 'patches/no-emojis.c') diff --git a/patches/no-emojis.c b/patches/no-emojis.c new file mode 100644 index 0000000..dc7dd89 --- /dev/null +++ b/patches/no-emojis.c @@ -0,0 +1,61 @@ +/* No Emojis: + * (from gtk3-classic patch 'other__hide-insert-emoji.patch') + * + * Hides the 'Insert Emoji' menu item found at the bottom of the context menus + * for GtkEntry and GtkTextView widgets. + * + * Set the environment variable GTKM_INSERT_EMOJI=1 to restore the menu items. + */ + + +#include +#include + +#include +#include + +#include + + +#undef G_LOG_DOMAIN +#define G_LOG_DOMAIN "Gtk3-Classic::No-Emojis" + + +INTERCEPTED_CLASS_METHOD (gtk_menu_item, show, + (GtkWidget * widget), + void) + + +void no_emojis_init () +{ + GtkMenuItemClass * gtk_menu_item_class = + g_type_class_ref (GTK_TYPE_MENU_ITEM); + + INTERCEPT_CLASS_METHOD ( + gtk_menu_item, GTK_WIDGET_CLASS, show) + + g_type_class_unref (gtk_menu_item_class); +} + + +static void +new_gtk_menu_item_show +(GtkWidget * widget) + +{ + const char * gtkm_insert_emoji; + const char * label; + + + CALL_ORIGINAL_CLASS_METHOD (gtk_menu_item, show, + (widget)); + + + gtkm_insert_emoji = getenv ("GTKM_INSERT_EMOJI"); + if (gtkm_insert_emoji != NULL && strcmp (gtkm_insert_emoji, "1") == 0) + return; + + label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + if (label != NULL && strcmp (label, _("Insert _Emoji")) == 0) + gtk_widget_hide (widget); +} -- cgit