[gtk+/wip/window-scales: 71/84] GtkImage: Set the window on the gtkiconhelper
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/window-scales: 71/84] GtkImage: Set the window on the gtkiconhelper
- Date: Wed, 26 Jun 2013 15:10:52 +0000 (UTC)
commit f4b9eee734679ccb3e5aa5f639bff2e57347c3e8
Author: Alexander Larsson <alexl redhat com>
Date: Mon Jun 24 14:06:20 2013 +0200
GtkImage: Set the window on the gtkiconhelper
gtk/gtkimage.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 83c107c..0b2a214 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;
@@ -1339,8 +1341,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]