static void gtk_image_menu_item_screen_changed (GtkWidget *widget, GdkScreen *previous_screen) { GtkSettings *settings; guint show_image_connection; if (!gtk_widget_has_screen (widget)) return; settings = gtk_widget_get_settings (widget); show_image_connection = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (settings), "gtk-image-menu-item-connection")); if (show_image_connection) return; show_image_connection = g_signal_connect (settings, "notify::gtk-menu-images", G_CALLBACK (gtk_image_menu_item_setting_changed), NULL); g_object_set_data (G_OBJECT (settings), I_("gtk-image-menu-item-connection"), GUINT_TO_POINTER (show_image_connection)); show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget)); }
static void traverse_container (GtkWidget *widget, gpointer data) { if (GTK_IS_IMAGE_MENU_ITEM (widget)) show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget)); else if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), traverse_container, NULL); }
static void gtk_image_menu_item_screen_changed (GtkWidget *widget, GdkScreen *previous_screen) { GtkSettings *settings; gulong show_image_connection; if (!gtk_widget_has_screen (widget)) return; settings = gtk_widget_get_settings (widget); show_image_connection = g_signal_handler_find (settings, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, gtk_image_menu_item_setting_changed, NULL); if (show_image_connection) return; g_signal_connect (settings, "notify::gtk-menu-images", G_CALLBACK (gtk_image_menu_item_setting_changed), NULL); show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget)); }