diff -r bf58b98751aa -r d9f973ac3afd pidgin/pidginavatar.c --- a/pidgin/pidginavatar.c Thu Sep 26 23:36:19 2024 -0500 +++ b/pidgin/pidginavatar.c Fri Sep 27 00:06:19 2024 -0500 @@ -56,6 +56,7 @@ PurpleAvatar *purple_avatar = NULL; GdkPixbufAnimation *animation = NULL; GdkPixbuf *pixbuf = NULL; + GdkTexture *texture = NULL; if(PURPLE_IS_CONTACT_INFO(avatar->info)) { purple_avatar = purple_contact_info_get_avatar(avatar->info); @@ -78,8 +79,11 @@ } } - gtk_picture_set_pixbuf(GTK_PICTURE(avatar->icon), pixbuf); + texture = gdk_texture_new_for_pixbuf(pixbuf); + gtk_picture_set_paintable(GTK_PICTURE(avatar->icon), + GDK_PAINTABLE(texture)); + g_clear_object(&texture); g_clear_object(&animation); } @@ -232,9 +236,6 @@ gtk_widget_init_template(GTK_WIDGET(avatar)); - gtk_picture_set_content_fit(GTK_PICTURE(avatar->icon), - GTK_CONTENT_FIT_SCALE_DOWN); - /* Now setup our actions. */ group = g_simple_action_group_new(); g_action_map_add_action_entries(G_ACTION_MAP(group), actions, @@ -319,17 +320,22 @@ avatar->animate = animate; if(GDK_IS_PIXBUF_ANIMATION(avatar->animation)) { + GdkTexture *texture = NULL; + if(avatar->animate && !gdk_pixbuf_animation_is_static_image(avatar->animation)) { - gtk_picture_set_pixbuf(GTK_PICTURE(avatar->icon), - GDK_PIXBUF(avatar->animation)); + texture = gdk_texture_new_for_pixbuf(GDK_PIXBUF(avatar->animation)); } else { GdkPixbuf *frame = NULL; frame = gdk_pixbuf_animation_get_static_image(avatar->animation); - gtk_picture_set_pixbuf(GTK_PICTURE(avatar->icon), frame); + texture = gdk_texture_new_for_pixbuf(frame); } + + gtk_picture_set_paintable(GTK_PICTURE(avatar->icon), + GDK_PAINTABLE(texture)); + g_object_unref(texture); } }