# HG changeset patch # User Ethan Blanton # Date 1143123656 0 # Node ID 40612ca8064308293ad283016ecfa4a36683649f # Parent 47c12348cfd147893fc405ea06e3fa2c3d825e41 [gaim-migrate @ 15929] This patch from Fernando Herrera traps the expose events used to redraw animated images in a GtkIMHtml such that they do not cause a redraw of the entire conversation. committer: Tailor Script diff -r 47c12348cfd1 -r 40612ca80643 src/gtkimhtml.c --- a/src/gtkimhtml.c Wed Mar 22 07:09:08 2006 +0000 +++ b/src/gtkimhtml.c Thu Mar 23 14:20:56 2006 +0000 @@ -4415,6 +4415,14 @@ gtk_imhtml_insert_smiley_at_iter(imhtml, sml, smiley, &iter); } +static gboolean +image_expose(GtkWidget *widget, GdkEventExpose *event, gpointer user_data) +{ + GTK_WIDGET_CLASS(GTK_WIDGET_GET_CLASS(widget))->expose_event(widget, event); + + return TRUE; +} + void gtk_imhtml_insert_smiley_at_iter(GtkIMHtml *imhtml, const char *sml, char *smiley, GtkTextIter *iter) { GdkPixbuf *pixbuf = NULL; @@ -4442,6 +4450,12 @@ g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", g_strdup(unescaped), g_free); g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); + /* This catches the expose events generated by animated + * images, and ensures that they are handled by the image + * itself, without propagating to the textview and causing + * a complete refresh */ + g_signal_connect(G_OBJECT(icon), "expose-event", G_CALLBACK(image_expose), NULL); + gtk_widget_show(icon); gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); } else if (imhtml_smiley != NULL && (imhtml->format_functions & GTK_IMHTML_SMILEY)) {