Entry: Handle :show-emoji-icon becoming false
authorDaniel Boles <dboles@src.gnome.org>
Mon, 28 Aug 2017 19:35:47 +0000 (20:35 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 28 Aug 2017 19:52:29 +0000 (20:52 +0100)
Disconnect the now-unwanted signal handler, and hide the icon.

https://bugzilla.gnome.org/show_bug.cgi?id=786940

gtk/gtkentry.c

index c3060e4909239b4dbe0d295485559ef8638c2448..58f167215822d791ad9a1481c8fed87f5931bdce 100644 (file)
@@ -11092,6 +11092,14 @@ set_show_emoji_icon (GtkEntry *entry,
 
       g_signal_connect (entry, "icon-press", G_CALLBACK (pick_emoji), NULL);
     }
+  else
+    {
+      g_signal_handlers_disconnect_by_func (entry, pick_emoji, NULL);
+
+      gtk_entry_set_icon_from_icon_name (entry,
+                                         GTK_ENTRY_ICON_SECONDARY,
+                                         NULL);
+    }
 
   g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_SHOW_EMOJI_ICON]);
   gtk_widget_queue_resize (GTK_WIDGET (entry));