From f3ee3a9446da7da3bc0cc9bdcd775f8da362fb21 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Mon, 3 Feb 2014 15:38:20 +0300 Subject: [PATCH] Scale down special icons (Bug 10653) gtk_icon_theme_lookup_by_gicon only returns icons that are close to what we requested. So scale those icons down if it is requred. Same fix as commit 596ac7b07939b3b93c6253b2db704a91e68e75d0 --- src/xfdesktop-file-utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c index 91ab61e..8fbd4a7 100644 --- a/src/xfdesktop-file-utils.c +++ b/src/xfdesktop-file-utils.c @@ -409,10 +409,17 @@ xfdesktop_file_utils_get_icon(GIcon *icon, if(pix_theme) { + GdkPixbuf *tmp; /* we can't edit thsese icons */ - pix = gdk_pixbuf_copy(pix_theme); + tmp = gdk_pixbuf_copy(pix_theme); + + /* ensure icons are within our size requirements since + * gtk_icon_theme_lookup_by_gicon isn't exact */ + pix = exo_gdk_pixbuf_scale_down(tmp, TRUE, width, height); + + g_object_unref(G_OBJECT(tmp)); g_object_unref(G_OBJECT(pix_theme)); - pix_theme = NULL; + pix_theme = tmp = NULL; } /* fallback */ -- 1.8.5.3