summaryrefslogtreecommitdiff
path: root/gtk/gtkoverlay.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-12-08 00:20:06 +0100
committerBenjamin Otte <otte@redhat.com>2011-12-08 00:24:28 +0100
commitf34d0d6f7b3987c5ecb73495c0aa1a9298f9eb53 (patch)
treeea1b6f84b924f24e9ef0a3196bcea68d4333fdd8 /gtk/gtkoverlay.c
parent6ed591871862ec87ee66fe69dca5c42087a12160 (diff)
downloadgtk+-f34d0d6f7b3987c5ecb73495c0aa1a9298f9eb53.tar.gz
overlay: Create child window before setting parent
Otherwise, the window will not be used when set_parent() maps the child.
Diffstat (limited to 'gtk/gtkoverlay.c')
-rw-r--r--gtk/gtkoverlay.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index e8b66aab4e..db9d1728e6 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -625,10 +625,14 @@ gtk_overlay_add_overlay (GtkOverlay *overlay,
child = g_slice_new0 (GtkOverlayChild);
child->widget = widget;
- gtk_widget_set_parent (widget, GTK_WIDGET (overlay));
-
priv->children = g_slist_append (priv->children, child);
if (gtk_widget_get_realized (GTK_WIDGET (overlay)))
- child->window = gtk_overlay_create_child_window (overlay, widget);
+ {
+ child->window = gtk_overlay_create_child_window (overlay, widget);
+ gtk_widget_set_parent (widget, GTK_WIDGET (overlay));
+ }
+ else
+ gtk_widget_set_parent (widget, GTK_WIDGET (overlay));
+
}