[gtk+] overlay: Create child window before setting parent
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] overlay: Create child window before setting parent
- Date: Wed, 7 Dec 2011 23:26:37 +0000 (UTC)
commit f34d0d6f7b3987c5ecb73495c0aa1a9298f9eb53
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 8 00:20:06 2011 +0100
overlay: Create child window before setting parent
Otherwise, the window will not be used when set_parent() maps the child.
gtk/gtkoverlay.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index e8b66aa..db9d172 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));
+
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]