summaryrefslogtreecommitdiff
path: root/gtk/gtkimage.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-06-24 14:06:20 +0200
committerAlexander Larsson <alexl@redhat.com>2013-07-03 14:39:26 +0200
commite042ffa71e427081fe975a5f3d5e23cba6d5eabb (patch)
treeeec0ccc9f1a5a47bab09b45fe6199a9512247f49 /gtk/gtkimage.c
parent5d8fd4ee247230e4ab97c223e618791f25f3ba24 (diff)
downloadgtk+-e042ffa71e427081fe975a5f3d5e23cba6d5eabb.tar.gz
GtkImage: Set the window on the gtkiconhelper
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r--gtk/gtkimage.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index c6b2dad0d8..f30ace2571 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -149,6 +149,7 @@ struct _GtkImagePrivate
static gint gtk_image_draw (GtkWidget *widget,
cairo_t *cr);
static void gtk_image_unmap (GtkWidget *widget);
+static void gtk_image_realize (GtkWidget *widget);
static void gtk_image_unrealize (GtkWidget *widget);
static void gtk_image_get_preferred_width (GtkWidget *widget,
gint *minimum,
@@ -217,6 +218,7 @@ gtk_image_class_init (GtkImageClass *class)
widget_class->get_preferred_height = gtk_image_get_preferred_height;
widget_class->get_preferred_height_and_baseline_for_width = gtk_image_get_preferred_height_and_baseline_for_width;
widget_class->unmap = gtk_image_unmap;
+ widget_class->realize = gtk_image_realize;
widget_class->unrealize = gtk_image_unrealize;
widget_class->style_updated = gtk_image_style_updated;
widget_class->screen_changed = gtk_image_screen_changed;
@@ -1362,8 +1364,24 @@ gtk_image_unmap (GtkWidget *widget)
}
static void
+gtk_image_realize (GtkWidget *widget)
+{
+ GtkImage *image = GTK_IMAGE (widget);
+ GtkImagePrivate *priv = image->priv;
+
+ GTK_WIDGET_CLASS (gtk_image_parent_class)->realize (widget);
+
+ _gtk_icon_helper_set_window (priv->icon_helper,
+ gtk_widget_get_window (widget));
+}
+
+static void
gtk_image_unrealize (GtkWidget *widget)
{
+ GtkImage *image = GTK_IMAGE (widget);
+ GtkImagePrivate *priv = image->priv;
+
+ _gtk_icon_helper_set_window (priv->icon_helper, NULL);
gtk_image_reset_anim_iter (GTK_IMAGE (widget));
GTK_WIDGET_CLASS (gtk_image_parent_class)->unrealize (widget);