[rhythmbox] backport fix for BGO #710493 / RH #1043259 (generate_images_hidden)
Adam Williamson
adamwill at fedoraproject.org
Thu Dec 26 17:18:06 UTC 2013
commit b4e4e3faa1d94a1c9dd1e411787c4819baf176f9
Author: Adam Williamson <awilliam at redhat.com>
Date: Thu Dec 26 09:17:52 2013 -0800
backport fix for BGO #710493 / RH #1043259 (generate_images_hidden)
generate_images_hidden.patch | 58 ++++++++++++++++++++++++++++++++++++++++++
rhythmbox.spec | 10 ++++++-
2 files changed, 67 insertions(+), 1 deletions(-)
---
diff --git a/generate_images_hidden.patch b/generate_images_hidden.patch
new file mode 100644
index 0000000..80e5c8a
--- /dev/null
+++ b/generate_images_hidden.patch
@@ -0,0 +1,58 @@
+From 344545b32a4fb7b1677be13bcb5c1f27eae7627f Mon Sep 17 00:00:00 2001
+From: Jonathan Matthew <jonathan at d14n.org>
+Date: Wed, 27 Nov 2013 07:41:10 +0000
+Subject: fading-image: stop trying to generate images while hidden
+
+When the allocated size of the widget is so small there's no space
+for the actual image, we shouldn't try to generate one. gdk-pixbuf
+and cairo don't like it much either.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=710493
+---
+diff --git a/widgets/rb-fading-image.c b/widgets/rb-fading-image.c
+index ec73f28..ed1813e 100644
+--- a/widgets/rb-fading-image.c
++++ b/widgets/rb-fading-image.c
+@@ -546,6 +546,10 @@ scale_thumbnail_if_necessary (RBFadingImage *image, GdkPixbuf *pixbuf)
+
+ w = gtk_widget_get_allocated_width (GTK_WIDGET (image)) - 2 * BORDER_WIDTH;
+ h = gtk_widget_get_allocated_height (GTK_WIDGET (image)) - 2 * BORDER_WIDTH;
++ if (w < 1 || h < 1) {
++ return NULL;
++ }
++
+ pw = gdk_pixbuf_get_width (pixbuf);
+ ph = gdk_pixbuf_get_height (pixbuf);
+
+@@ -644,8 +648,18 @@ composite_into_current (RBFadingImage *image)
+ int width;
+ int height;
+
++ if (image->priv->current_pat != NULL) {
++ cairo_pattern_destroy (image->priv->current_pat);
++ }
+ width = gtk_widget_get_allocated_width (GTK_WIDGET (image)) - 2 * BORDER_WIDTH;
+ height = gtk_widget_get_allocated_height (GTK_WIDGET (image)) - 2 * BORDER_WIDTH;
++ if (width < 1 || height < 1) {
++ image->priv->current_pat = NULL;
++ image->priv->current_width = 0;
++ image->priv->current_height = 0;
++ return;
++ }
++
+ dest = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
+
+ cr = cairo_create (dest);
+@@ -653,9 +667,6 @@ composite_into_current (RBFadingImage *image)
+ render_next (image, cr, width, height, FALSE);
+ cairo_destroy (cr);
+
+- if (image->priv->current_pat != NULL) {
+- cairo_pattern_destroy (image->priv->current_pat);
+- }
+ image->priv->current_pat = cairo_pattern_create_for_surface (dest);
+ image->priv->current_width = width;
+ image->priv->current_height = height;
+--
+cgit v0.9.2
+
diff --git a/rhythmbox.spec b/rhythmbox.spec
index 0052e37..ee29d4a 100644
--- a/rhythmbox.spec
+++ b/rhythmbox.spec
@@ -5,13 +5,17 @@
Name: rhythmbox
Summary: Music Management Application
Version: 3.0.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2+ with exceptions and GFDL
Group: Applications/Multimedia
URL: http://projects.gnome.org/rhythmbox/
#VCS: git://git.gnome.org/rhythmbox
Source: http://download.gnome.org/sources/rhythmbox/3.0/%{name}-%{version}.tar.xz
+# https://bugzilla.gnome.org/show_bug.cgi?id=710493
+# Upstream 344545b32a
+Patch0: generate_images_hidden.patch
+
Requires: gnome-icon-theme-legacy
Requires: gtk3%{?_isa} >= %{gtk3_version}
Requires: libdmapsharing%{?_isa} >= %{libdmapsharing_version}
@@ -86,6 +90,7 @@ a Rhythmbox plugin.
%prep
%setup -q
+%patch0 -p1 -b .images
%build
%configure \
@@ -185,6 +190,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || :
%{_datadir}/gir-1.0/*.gir
%changelog
+* Thu Dec 26 2013 Adam Williamson <awilliam at redhat.com> - 3.0.1-2
+- backport fix for BGO #710493 / RH #1043259 (generate_images_hidden)
+
* Tue Dec 10 2013 Adam Williamson <awilliam at redhat.com> - 3.0.1-1
- new upstream release 3.0.1
More information about the scm-commits
mailing list