diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-08-03 08:51:40 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-08-03 09:04:47 +0200 |
commit | e6a8848d0cb85e4030a72c638c86a10956761935 (patch) | |
tree | 3bad779e5a84f43257a4b6b895d35a6af5bd5252 /gtk/gtkcontainer.c | |
parent | e63bfabb0783954bcd11bd71ec62d0982ce8bcf4 (diff) | |
download | gtk+-e6a8848d0cb85e4030a72c638c86a10956761935.tar.gz |
Be more forgiving about child properties
Packing properties in ui files are parsed and handled by
the container, which assumes that the child is a direct
descendant. For internal children, this is inconvenient,
because we don't want to reconstruct the entire internal
structure between the container and the child in the ui
file.
It would be best to not specify packing properties
in that case, but since existing ui files do this for
GtkInfoBar and we are about to change the internal
structure of GtkInfoBar, be more forgiving here.
Diffstat (limited to 'gtk/gtkcontainer.c')
-rw-r--r-- | gtk/gtkcontainer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index b1be6fe9b5..b118346ec9 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -582,6 +582,14 @@ gtk_container_buildable_set_child_property (GtkContainer *container, GValue gvalue = G_VALUE_INIT; GError *error = NULL; + if (gtk_widget_get_parent (child) != (GtkWidget *)container) + { + /* This can happen with internal children of complex + * widgets. Silently ignore the child properties in this case. + */ + return; + } + pspec = gtk_container_class_find_child_property (G_OBJECT_GET_CLASS (container), name); if (!pspec) |