summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-03-03 06:40:53 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-03-03 06:40:53 +0000
commitd74feca09e34efe3f89013512731e315d88fc813 (patch)
tree822868f106d4e4ad060af9b95c4ecf7c1cfd1f19 /gtk
parentaad5057b51b1e1638f6089fe2495e75e6f18a026 (diff)
downloadgtk+-d74feca09e34efe3f89013512731e315d88fc813.tar.gz
Avoid warnings if gtk_widget_reparent() is called at unusual times.
2005-03-03 Matthias Clasen <mclasen@redhat.com> * gtk/gtkwidget.c (gtk_widget_reparent_subwindows): Avoid warnings if gtk_widget_reparent() is called at unusual times. (#168966, Christian Persch)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkwidget.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3a4f76bd85..29ee934a9e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3730,21 +3730,27 @@ gtk_widget_reparent_subwindows (GtkWidget *widget,
}
else
{
- GdkWindow *parent = gdk_window_get_parent (widget->window);
+ GdkWindow *parent;
+ GList *tmp_list, *children;
- GList *children = gdk_window_get_children (parent);
- GList *tmp_list;
- for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
- {
- GtkWidget *child;
- GdkWindow *window = tmp_list->data;
+ parent = gdk_window_get_parent (widget->window);
- gdk_window_get_user_data (window, (void **)&child);
- if (child == widget)
- gdk_window_reparent (window, new_window, 0, 0);
+ if (parent)
+ {
+ children = gdk_window_get_children (parent);
+
+ for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
+ {
+ GtkWidget *child;
+ GdkWindow *window = tmp_list->data;
+
+ gdk_window_get_user_data (window, (void **)&child);
+ if (child == widget)
+ gdk_window_reparent (window, new_window, 0, 0);
+ }
+
+ g_list_free (children);
}
-
- g_list_free (children);
}
}