diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index d1e8da5..8fb987e 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -42,6 +42,8 @@
 #include <gobject/gvaluecollector.h>
 #include "gtkalias.h"
 
+#define GTK_WIDGET_COMPOSITE_CHILD(wid) \
+        ((GTK_OBJECT_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
 
 enum {
   ADD,
@@ -1198,6 +1200,12 @@ gtk_container_add (GtkContainer *container,
       return;
     }
 
+  if (g_getenv ("GTK_ENABLE_DIAGNOSTIC"))
+    if (GTK_WIDGET_COMPOSITE_CHILD (widget))
+      g_warning ("A %s is being added to a %s. "
+                 "Adding children to internal widgets is not supported.",
+                 G_OBJECT_TYPE_NAME (widget), G_OBJECT_TYPE_NAME (container));
+
   g_signal_emit (container, container_signals[ADD], 0, widget);
 }
 
@@ -1229,6 +1237,12 @@ gtk_container_remove (GtkContainer *container,
    */
   g_return_if_fail (GTK_IS_TOOLBAR (container) ||
 		    widget->parent == GTK_WIDGET (container));
+
+  if (g_getenv ("GTK_ENABLE_DIAGNOSTIC"))
+    if (GTK_WIDGET_COMPOSITE_CHILD (widget))
+      g_warning ("An internal %s is being removed from a %s. "
+                 "Removing internal children from containers is not supported.",
+                 G_OBJECT_TYPE_NAME (widget), G_OBJECT_TYPE_NAME (container));
   
   g_signal_emit (container, container_signals[REMOVE], 0, widget);
 }
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 2556c14..2998ed4 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -253,11 +253,15 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
 
   gtk_widget_style_get (GTK_WIDGET (statusbar), "shadow-type", &shadow_type, NULL);
   
+  gtk_widget_push_composite_child ();
+
   statusbar->frame = gtk_frame_new (NULL);
   gtk_frame_set_shadow_type (GTK_FRAME (statusbar->frame), shadow_type);
   gtk_box_pack_start (box, statusbar->frame, TRUE, TRUE, 0);
   gtk_widget_show (statusbar->frame);
 
+  gtk_widget_pop_composite_child ();
+
   message_area = gtk_hbox_new (FALSE, 4);
   gtk_container_add (GTK_CONTAINER (statusbar->frame), message_area);
   gtk_widget_show (message_area);
