# HG changeset patch # User Luke Schierer # Date 1063853591 0 # Node ID 4f8258b2bb8de102596cea14d471bc843e0992df # Parent b1c21872cf0fb59414a9b303ddd200dea9000438 [gaim-migrate @ 7428] Tim Ringenbach (marv_sf) writes: " This fixes the issues with nonannimated yahoo smilies having black backgrounds." committer: Tailor Script diff -r b1c21872cf0f -r 4f8258b2bb8d src/gtkimhtml.c --- a/src/gtkimhtml.c Wed Sep 17 22:50:56 2003 +0000 +++ b/src/gtkimhtml.c Thu Sep 18 02:53:11 2003 +0000 @@ -1353,7 +1353,7 @@ NEW_BIT (NEW_COMMENT_BIT); break; default: - break; + break; } c += tlen; pos += tlen; @@ -1373,8 +1373,9 @@ pos++; } else if (imhtml->show_smileys && (gtk_imhtml_is_smiley (imhtml, fonts, c, &smilelen) || gtk_imhtml_is_smiley(imhtml, NULL, c, &smilelen))) { GtkTextChildAnchor *anchor; - GtkWidget *icon; - GdkPixbufAnimation *pixbuf; + GtkWidget *icon = NULL; + GdkPixbufAnimation *annipixbuf = NULL; + GdkPixbuf *pixbuf = NULL; GtkIMHtmlFontDetail *fd; gchar *sml = NULL; if (fonts) { @@ -1384,9 +1385,18 @@ NEW_BIT (NEW_TEXT_BIT); wpos = g_snprintf (ws, smilelen + 1, "%s", c); anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter); - pixbuf = gtk_smiley_tree_image(imhtml, sml, ws); - if(pixbuf){ - icon = gtk_image_new_from_animation(pixbuf); + annipixbuf = gtk_smiley_tree_image(imhtml, sml, ws); + if(annipixbuf) { + if(gdk_pixbuf_animation_is_static_image(annipixbuf)) { + pixbuf = gdk_pixbuf_animation_get_static_image(annipixbuf); + if(pixbuf) + icon = gtk_image_new_from_pixbuf(pixbuf); + } else { + icon = gtk_image_new_from_animation(annipixbuf); + } + } + + if (icon) { gtk_widget_show(icon); gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); }