Updating branch refs/heads/ristretto-0.0 to a07d682816dffb989b62eac47f2fbd6f02770201 (commit) from abedf056b8badfb414c41efe142d7ba2bae81172 (commit)
commit a07d682816dffb989b62eac47f2fbd6f02770201 Author: Stephan Arts <step...@xfce.org> Date: Sun Jun 21 10:27:16 2009 +0200 Don't generate the missing-image thumbnail on every expose event. src/thumbnail.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/thumbnail.c b/src/thumbnail.c index 654bf91..94f7abc 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -32,6 +32,7 @@ struct _RsttoThumbnailPriv }; static GtkWidgetClass *parent_class = NULL; +static GdkPixbuf *thumbnail_missing_icon = NULL; static void rstto_thumbnail_init(RsttoThumbnail *); @@ -88,6 +89,16 @@ rstto_thumbnail_init(RsttoThumbnail *thumb) { thumb->priv = g_new0(RsttoThumbnailPriv, 1); + if (thumbnail_missing_icon == NULL) + { + thumbnail_missing_icon = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(), + "image-missing", + 128, + 0, + NULL); + } + + gtk_widget_set_redraw_on_allocate(GTK_WIDGET(thumb), TRUE); gtk_widget_set_events (GTK_WIDGET(thumb), GDK_POINTER_MOTION_MASK); @@ -173,17 +184,11 @@ rstto_thumbnail_expose(GtkWidget *widget, GdkEventExpose *event) if (thumb_pixbuf == NULL) { - thumb_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(), - "image-missing", - 128, - 0, - NULL); - } - else - { - g_object_ref (thumb_pixbuf); + thumb_pixbuf = thumbnail_missing_icon; } + g_object_ref (thumb_pixbuf); + if (thumb_pixbuf) { gint height = gdk_pixbuf_get_height (thumb->priv->pixbuf) - 10; _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits