From owner-svn-ports-all@FreeBSD.ORG Mon Mar 18 14:46:26 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7CF9FBD5; Mon, 18 Mar 2013 14:46:26 +0000 (UTC) (envelope-from olivierd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC147F0F; Mon, 18 Mar 2013 14:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2IEkPfV078708; Mon, 18 Mar 2013 14:46:25 GMT (envelope-from olivierd@svn.freebsd.org) Received: (from olivierd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2IEkPZ6078706; Mon, 18 Mar 2013 14:46:25 GMT (envelope-from olivierd@svn.freebsd.org) Message-Id: <201303181446.r2IEkPZ6078706@svn.freebsd.org> From: Olivier Duchateau Date: Mon, 18 Mar 2013 14:46:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r314575 - in head/x11-wm/xfce4-desktop: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2013 14:46:26 -0000 Author: olivierd Date: Mon Mar 18 14:46:25 2013 New Revision: 314575 URL: http://svnweb.freebsd.org/changeset/ports/314575 Log: Force to scale XPM icons with recent update of graphics/gdk-pixbuf2 While here, - Use USES=pathfix instead of gnomehack Added: head/x11-wm/xfce4-desktop/files/patch-src__xfdesktop-app-menu-item.c (contents, props changed) Modified: head/x11-wm/xfce4-desktop/Makefile Modified: head/x11-wm/xfce4-desktop/Makefile ============================================================================== --- head/x11-wm/xfce4-desktop/Makefile Mon Mar 18 14:46:13 2013 (r314574) +++ head/x11-wm/xfce4-desktop/Makefile Mon Mar 18 14:46:25 2013 (r314575) @@ -4,6 +4,7 @@ PORTNAME= xfce4-desktop PORTVERSION= 4.10.2 +PORTREVISION= 1 CATEGORIES= x11-wm xfce MASTER_SITES= ${MASTER_SITE_XFCE} MASTER_SITE_SUBDIR= src/xfce/xfdesktop/${PORTVERSION:R} @@ -21,9 +22,10 @@ GNU_CONFIGURE= yes INSTALLS_ICONS= yes USE_BZIP2= yes USE_GMAKE= yes -USE_GNOME= glib20 gnomehack gtk20 intltool intlhack desktopfileutils +USE_GNOME= glib20 gtk20 intltool intlhack desktopfileutils USE_XFCE= configenv garcon libmenu libutil libexo xfconf USE_PKGCONFIG= build +USES= pathfix USE_XORG= x11 sm CONFIGURE_ARGS+=--enable-gio-unix \ Added: head/x11-wm/xfce4-desktop/files/patch-src__xfdesktop-app-menu-item.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-wm/xfce4-desktop/files/patch-src__xfdesktop-app-menu-item.c Mon Mar 18 14:46:25 2013 (r314575) @@ -0,0 +1,78 @@ +--- ./src/xfdesktop-app-menu-item.c.orig 2013-03-02 16:40:19.000000000 +0000 ++++ ./src/xfdesktop-app-menu-item.c 2013-03-18 09:50:38.000000000 +0000 +@@ -28,6 +28,10 @@ + #include + #endif + ++#ifdef HAVE_MATH_H ++#include ++#endif ++ + #include + + #include +@@ -169,8 +173,11 @@ + xfdesktop_app_menu_item_set_icon(XfdesktopAppMenuItem *app_menu_item) + { + const gchar *icon_name; +- gint w, h, size; ++ gint w, h, size, new_size; ++ gint src_w, src_h; ++ gdouble wratio, hratio; + GdkPixbuf *pixbuf = NULL; ++ GdkPixbuf *dest; + GtkWidget *image = NULL; + GtkIconTheme *icon_theme; + gchar *p, *name = NULL; +@@ -187,7 +194,7 @@ + image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_MENU); + else { + if (g_path_is_absolute(icon_name)) { +- pixbuf = gdk_pixbuf_new_from_file_at_scale(icon_name, w, h, TRUE, NULL); ++ pixbuf = gdk_pixbuf_new_from_file(icon_name, NULL); + } else { + /* try to lookup names like application.png in the theme */ + p = strrchr(icon_name, '.'); +@@ -206,11 +213,41 @@ + } + + if(name) { +- pixbuf = gdk_pixbuf_new_from_file_at_scale(name, w, h, TRUE, NULL); ++ pixbuf = gdk_pixbuf_new_from_file(name, NULL); + g_free(name); + } + } + ++ /* scale the pixbuf */ ++ if(G_LIKELY(pixbuf)) { ++ /* 24x24 pixels looks good */ ++ new_size = MIN(24, 24); ++ ++ src_w = gdk_pixbuf_get_width(pixbuf); ++ src_h = gdk_pixbuf_get_height(pixbuf); ++ ++ if(src_w > 24 || src_h > 24) { ++ /* calculate the new dimensions */ ++ wratio = (gdouble) src_w / (gdouble) new_size; ++ hratio = (gdouble) src_h / (gdouble) new_size; ++ ++ if(hratio == wratio) { ++ w = rint(src_w / hratio); ++ h = rint(src_h / hratio); ++ } ++ else if(hratio > wratio) ++ w = rint(src_w / hratio); ++ else ++ h = rint(src_h / wratio); ++ ++ dest = gdk_pixbuf_scale_simple(pixbuf, ++ MAX(w, 1), MAX(h, 1), GDK_INTERP_BILINEAR); ++ ++ g_object_unref(G_OBJECT(pixbuf)); ++ pixbuf = dest; ++ } ++ } ++ + /* Turn the pixbuf into a gtk_image */ + if(G_LIKELY(pixbuf)) { + image = gtk_image_new_from_pixbuf(pixbuf);