+Thu Nov 7 17:18:06 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_pixbuf):
+ Don't try to use render if we can't get a picture for
+ the drawable. (Fixes #97220, reported by
+ Jamie Zawinski)
+
+ * gtk/gtkimage.c: Force requisition calculation
+ when we get a expose prior to size_request().
+ (#91711, reported by Sven Neumann, debugging
+ help from Matthias Clasen, Soeren Sandmann)
+
Thu Nov 7 16:45:54 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkx.h: Fix misplaced display_grab()/display_ungrab();
+Thu Nov 7 17:18:06 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_pixbuf):
+ Don't try to use render if we can't get a picture for
+ the drawable. (Fixes #97220, reported by
+ Jamie Zawinski)
+
+ * gtk/gtkimage.c: Force requisition calculation
+ when we get a expose prior to size_request().
+ (#91711, reported by Sven Neumann, debugging
+ help from Matthias Clasen, Soeren Sandmann)
+
Thu Nov 7 16:45:54 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkx.h: Fix misplaced display_grab()/display_ungrab();
+Thu Nov 7 17:18:06 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_pixbuf):
+ Don't try to use render if we can't get a picture for
+ the drawable. (Fixes #97220, reported by
+ Jamie Zawinski)
+
+ * gtk/gtkimage.c: Force requisition calculation
+ when we get a expose prior to size_request().
+ (#91711, reported by Sven Neumann, debugging
+ help from Matthias Clasen, Soeren Sandmann)
+
Thu Nov 7 16:45:54 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkx.h: Fix misplaced display_grab()/display_ungrab();
+Thu Nov 7 17:18:06 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_pixbuf):
+ Don't try to use render if we can't get a picture for
+ the drawable. (Fixes #97220, reported by
+ Jamie Zawinski)
+
+ * gtk/gtkimage.c: Force requisition calculation
+ when we get a expose prior to size_request().
+ (#91711, reported by Sven Neumann, debugging
+ help from Matthias Clasen, Soeren Sandmann)
+
Thu Nov 7 16:45:54 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkx.h: Fix misplaced display_grab()/display_ungrab();
+Thu Nov 7 17:18:06 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_pixbuf):
+ Don't try to use render if we can't get a picture for
+ the drawable. (Fixes #97220, reported by
+ Jamie Zawinski)
+
+ * gtk/gtkimage.c: Force requisition calculation
+ when we get a expose prior to size_request().
+ (#91711, reported by Sven Neumann, debugging
+ help from Matthias Clasen, Soeren Sandmann)
+
Thu Nov 7 16:45:54 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkx.h: Fix misplaced display_grab()/display_ungrab();
+Thu Nov 7 17:18:06 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_pixbuf):
+ Don't try to use render if we can't get a picture for
+ the drawable. (Fixes #97220, reported by
+ Jamie Zawinski)
+
+ * gtk/gtkimage.c: Force requisition calculation
+ when we get a expose prior to size_request().
+ (#91711, reported by Sven Neumann, debugging
+ help from Matthias Clasen, Soeren Sandmann)
+
Thu Nov 7 16:45:54 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkx.h: Fix misplaced display_grab()/display_ungrab();
if (format_type == FORMAT_NONE ||
!gdk_pixbuf_get_has_alpha (pixbuf) ||
- (dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24))
+ (dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24) ||
+ gdk_x11_drawable_get_picture (drawable) == None)
{
GdkDrawable *wrapper = GDK_DRAWABLE_IMPL_X11 (drawable)->wrapper;
GDK_DRAWABLE_CLASS (parent_class)->draw_pixbuf (wrapper, gc, pixbuf,
static void gtk_image_destroy (GtkObject *object);
static void gtk_image_clear (GtkImage *image);
static void gtk_image_reset (GtkImage *image);
+static void gtk_image_calc_size (GtkImage *image);
+
static void gtk_image_update_size (GtkImage *image,
gint image_width,
gint image_height);
misc = GTK_MISC (widget);
area = event->area;
+
+ /* For stock items and icon sets, we lazily calculate
+ * the size; we might get here between a queue_resize()
+ * and size_request() if something explicitely forces
+ * a redraw.
+ */
+ if (widget->requisition.width == 0 && widget->requisition.height == 0)
+ gtk_image_calc_size (image);
if (!gdk_rectangle_intersect (&area, &widget->allocation, &area))
return FALSE;
}
static void
-gtk_image_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+gtk_image_calc_size (GtkImage *image)
{
- GtkImage *image;
+ GtkWidget *widget = GTK_WIDGET (image);
GdkPixbuf *pixbuf = NULL;
- image = GTK_IMAGE (widget);
-
/* 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
* is set.
*/
-
switch (image->storage_type)
{
case GTK_IMAGE_STOCK:
- pixbuf = gtk_widget_render_icon (GTK_WIDGET (image),
+ pixbuf = gtk_widget_render_icon (widget,
image->data.stock.stock_id,
image->icon_size,
NULL);
break;
-
+
case GTK_IMAGE_ICON_SET:
pixbuf = gtk_icon_set_render_icon (image->data.icon_set.icon_set,
widget->style,
if (pixbuf)
{
- GTK_WIDGET (image)->requisition.width = gdk_pixbuf_get_width (pixbuf) + GTK_MISC (image)->xpad * 2;
- GTK_WIDGET (image)->requisition.height = gdk_pixbuf_get_height (pixbuf) + GTK_MISC (image)->ypad * 2;
+ widget->requisition.width = gdk_pixbuf_get_width (pixbuf) + GTK_MISC (image)->xpad * 2;
+ widget->requisition.height = gdk_pixbuf_get_height (pixbuf) + GTK_MISC (image)->ypad * 2;
g_object_unref (pixbuf);
}
+}
+
+static void
+gtk_image_size_request (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ GtkImage *image;
+
+ image = GTK_IMAGE (widget);
+
+ gtk_image_calc_size (image);
/* Chain up to default that simply reads current requisition */
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
if (GTK_WIDGET_VISIBLE (image))
gtk_widget_queue_resize (GTK_WIDGET (image));
}
-
-