@@ -585,8 +585,8 @@ caja_bookmark_new (GFile *location, const char *name, gboolean has_custom_name,
585
585
return new_bookmark ;
586
586
}
587
587
588
- static GtkWidget *
589
- create_image_widget_for_bookmark (CajaBookmark * bookmark )
588
+ static cairo_surface_t *
589
+ create_image_cairo_for_bookmark (CajaBookmark * bookmark )
590
590
{
591
591
cairo_surface_t * surface ;
592
592
GtkWidget * widget ;
@@ -597,23 +597,20 @@ create_image_widget_for_bookmark (CajaBookmark *bookmark)
597
597
return NULL ;
598
598
}
599
599
600
- widget = gtk_image_new_from_surface (surface );
601
-
602
- cairo_surface_destroy (surface );
603
- return widget ;
600
+ return surface ;
604
601
}
605
602
606
603
static GtkWidget *
607
- bookmark_image_menu_item_new_from_pixbuf ( GdkPixbuf * icon_pixbuf ,
608
- const gchar * label_name )
604
+ bookmark_image_menu_item_new_from_surface ( cairo_surface_t * icon_surface ,
605
+ const gchar * label_name )
609
606
{
610
607
GtkWidget * icon ;
611
608
GtkLabel * label ;
612
609
613
610
GtkWidget * box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 6 );
614
611
615
- if (icon_pixbuf )
616
- icon = gtk_image_new_from_pixbuf ( icon_pixbuf );
612
+ if (icon_surface )
613
+ icon = gtk_image_new_from_surface ( icon_surface );
617
614
else
618
615
icon = gtk_image_new ();
619
616
@@ -645,15 +642,12 @@ bookmark_image_menu_item_new_from_pixbuf (GdkPixbuf *icon_pixbuf,
645
642
GtkWidget *
646
643
caja_bookmark_menu_item_new (CajaBookmark * bookmark )
647
644
{
648
- GdkPixbuf * icon ;
649
645
GtkWidget * menu_item ;
650
- GtkWidget * image_widget ;
651
-
652
- image_widget = create_image_widget_for_bookmark (bookmark );
646
+ cairo_surface_t * image_cairo ;
653
647
654
- icon = gtk_image_get_pixbuf ( GTK_IMAGE ( image_widget ) );
648
+ image_cairo = create_image_cairo_for_bookmark ( bookmark );
655
649
656
- menu_item = bookmark_image_menu_item_new_from_pixbuf ( icon , bookmark -> details -> name );
650
+ menu_item = bookmark_image_menu_item_new_from_surface ( image_cairo , bookmark -> details -> name );
657
651
658
652
return menu_item ;
659
653
}
0 commit comments