rpms/gtk2/F-12 image-size-alloc.patch, NONE, 1.1 gtk2.spec, 1.414, 1.415

Matthias Clasen mclasen at fedoraproject.org
Sun Oct 18 05:43:10 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gtk2/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18009

Modified Files:
	gtk2.spec 
Added Files:
	image-size-alloc.patch 
Log Message:
Fix a size allocation problem


image-size-alloc.patch:
 gtkimage.c |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

--- NEW FILE image-size-alloc.patch ---
--- /home/mclasen/git.gnome.org/gtk+/gtk/gtkimage.c	2009-06-04 15:18:04.063943764 -0400
+++ gtk+-2.18.3/gtk/gtkimage.c	2009-10-18 01:31:00.705062264 -0400
@@ -45,6 +45,7 @@
   gchar *filename;
 
   gint pixel_size;
+  guint need_calc_size : 1;
 };
 
 #define GTK_IMAGE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_IMAGE, GtkImagePrivate))
@@ -1710,6 +1711,7 @@
     {
       GtkImage *image;
       GtkMisc *misc;
+      GtkImagePrivate *priv;
       GdkRectangle area, image_bound;
       gfloat xalign;
       gint x, y, mask_x, mask_y;
@@ -1719,6 +1721,7 @@
 
       image = GTK_IMAGE (widget);
       misc = GTK_MISC (widget);
+      priv = GTK_IMAGE_GET_PRIVATE (image);
 
       area = event->area;
 
@@ -1727,7 +1730,7 @@
        * and size_request() if something explicitely forces
        * a redraw.
        */
-      if (widget->requisition.width == 0 && widget->requisition.height == 0)
+      if (priv->need_calc_size)
 	gtk_image_calc_size (image);
       
       if (!gdk_rectangle_intersect (&area, &widget->allocation, &area))
@@ -1737,7 +1740,7 @@
 	xalign = misc->xalign;
       else
 	xalign = 1.0 - misc->xalign;
-  
+
       x = floor (widget->allocation.x + misc->xpad
 		 + ((widget->allocation.width - widget->requisition.width) * xalign));
       y = floor (widget->allocation.y + misc->ypad 
@@ -2149,8 +2152,13 @@
 void
 gtk_image_clear (GtkImage *image)
 {
-  gtk_image_reset (image);
+  GtkImagePrivate *priv;
+
+  priv = GTK_IMAGE_GET_PRIVATE (image);
+
+  priv->need_calc_size = 1;
 
+  gtk_image_reset (image);
   gtk_image_update_size (image, 0, 0);
 }
 
@@ -2159,7 +2167,12 @@
 {
   GtkWidget *widget = GTK_WIDGET (image);
   GdkPixbuf *pixbuf = NULL;
-  
+  GtkImagePrivate *priv;
+
+  priv = GTK_IMAGE_GET_PRIVATE (image);
+
+  priv->need_calc_size = 0;
+
   /* We update stock/icon set on every size request, because
    * the theme could have affected the size; for other kinds of
    * image, we just update the requisition when the image data


Index: gtk2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/F-12/gtk2.spec,v
retrieving revision 1.414
retrieving revision 1.415
diff -u -p -r1.414 -r1.415
--- gtk2.spec	18 Oct 2009 03:59:13 -0000	1.414
+++ gtk2.spec	18 Oct 2009 05:43:09 -0000	1.415
@@ -17,7 +17,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.gnome.org/sources/gtk+/2.18/gtk+-%{version}.tar.bz2
@@ -30,6 +30,8 @@ Patch0: gtk+-2.13.5-lib64.patch
 Patch1: system-python.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=583273
 Patch2: icon-padding.patch
+# from upstream
+Patch3: image-size-alloc.patch
 
 BuildRequires: atk-devel >= %{atk_version}
 BuildRequires: pango-devel >= %{pango_version}
@@ -143,6 +145,7 @@ This package contains developer document
 %patch0 -p1 -b .lib64
 %patch1 -p1 -b .system-python
 %patch2 -p1 -b .icon-padding
+%patch3 -p1 -b .image-size-alloc
 
 %build
 libtoolize --force --copy
@@ -379,6 +382,9 @@ fi
 
 
 %changelog
+* Sun Oct 18 2009 Matthias Clasen <mclasen at redhat.com> - 2.18.3-3
+- Fix a size allocation problem uncovered by the previous patch
+
 * Sat Oct 17 2009 Matthias Clasen <mclasen at redhat.com> - 2.18.3-2
 - Support padding around status icons
 




More information about the fedora-extras-commits mailing list