[Xfce4-commits] <xfdesktop:master> Scale down special icons (Bug 10653)

Eric Koegel noreply at xfce.org
Tue Feb 4 17:06:01 CET 2014


Updating branch refs/heads/master
         to 9160a163e60bda06f5a1f550b5c04f846ff3817a (commit)
       from c585aff2aaf90e0c9350355b0096371f3cdc679a (commit)

commit 9160a163e60bda06f5a1f550b5c04f846ff3817a
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Feb 3 15:38:20 2014 +0300

    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 */


More information about the Xfce4-commits mailing list