changeset 1932:be30d74bd3a8

[gaim-migrate @ 1942] here, this will solve all your problems committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 01 Jun 2001 16:54:24 +0000
parents e86f357ec23d
children e9f926eaf0c9
files src/oscar.c
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/oscar.c	Fri Jun 01 02:54:39 2001 +0000
+++ b/src/oscar.c	Fri Jun 01 16:54:24 2001 +0000
@@ -1606,6 +1606,8 @@
 	GdkPixbufFrame *frame;
 	GdkPixbuf *buf;
 	GdkPixmap *pm; GdkBitmap *bm;
+	GdkPixmap *src;
+	GdkGC *gc;
 
 	if (!ir->cnv || !g_list_find(conversations, ir->cnv)) {
 		debug_printf("I think this is a bug.\n");
@@ -1615,35 +1617,34 @@
 	frames = gdk_pixbuf_animation_get_frames(ir->anim);
 	frame = g_list_nth_data(frames, ir->curframe);
 	buf = gdk_pixbuf_frame_get_pixbuf(frame);
-	gtk_pixmap_get(GTK_PIXMAP(ir->pix), &pm, &bm);
 	switch (gdk_pixbuf_frame_get_action(frame)) {
-		case GDK_PIXBUF_FRAME_RETAIN: {
-			GdkPixmap *src;
-			GdkGC *gc = gdk_gc_new(pm);
+		case GDK_PIXBUF_FRAME_RETAIN:
 			gdk_pixbuf_render_pixmap_and_mask(buf, &src, NULL, 0);
+			gtk_pixmap_get(GTK_PIXMAP(ir->pix), &pm, &bm);
+			gc = gdk_gc_new(pm);
 			gdk_draw_pixmap(pm, gc, src, 0, 0,
 					gdk_pixbuf_frame_get_x_offset(frame),
 					gdk_pixbuf_frame_get_y_offset(frame),
 					-1, -1);
 			gdk_pixmap_unref(src);
-			gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm);
 			gtk_widget_queue_draw(ir->pix);
 			gdk_gc_unref(gc);
-					      }
 			break;
 		case GDK_PIXBUF_FRAME_DISPOSE:
 			gdk_pixbuf_render_pixmap_and_mask(buf, &pm, &bm, 0);
 			gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm);
+			gdk_pixmap_unref(pm);
+			gdk_bitmap_unref(bm);
 			break;
 		case GDK_PIXBUF_FRAME_REVERT:
 			frame = frames->data;
 			buf = gdk_pixbuf_frame_get_pixbuf(frame);
 			gdk_pixbuf_render_pixmap_and_mask(buf, &pm, &bm, 0);
 			gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm);
+			gdk_pixmap_unref(pm);
+			gdk_bitmap_unref(bm);
 			break;
 	}
-	gdk_pixmap_unref(pm);
-	gdk_bitmap_unref(bm);
 	ir->curframe = (ir->curframe + 1) % g_list_length(frames);
 	delay = gdk_pixbuf_frame_get_delay_time(frame);
 	ir->timer = gtk_timeout_add(delay * 10, redraw_anim, ir);