diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 8b721d0..a35e277 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1198,6 +1198,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 +1235,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/gtknotebook.c b/gtk/gtknotebook.c
index 73afbc1..3bf77ee 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -666,7 +666,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
 						     -1,
 						     G_MAXINT,
 						     -1,
-						     GTK_PARAM_READWRITE));
+						     GTK_PARAM_READWRITE | GTK_PARAM_DEPRECATED));
 
   /**
    * GtkNotebook:group:
@@ -723,7 +723,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
 								 P_("Tab pack type"),
 								 P_("A GtkPackType indicating whether the child is packed with reference to the start or end of the parent"),
 								 GTK_TYPE_PACK_TYPE, GTK_PACK_START,
-								 GTK_PARAM_READWRITE));
+								 GTK_PARAM_READWRITE | GTK_PARAM_DEPRECATED));
   gtk_container_class_install_child_property (container_class,
 					      CHILD_PROP_REORDERABLE,
 					      g_param_spec_boolean ("reorderable",
@@ -1511,6 +1511,8 @@ gtk_notebook_set_property (GObject         *object,
 {
   GtkNotebook *notebook;
 
+  GTK_OBJECT_WARN_UNSUPPORTED_PROPERTY (object, pspec);
+
   notebook = GTK_NOTEBOOK (object);
 
   switch (prop_id)
@@ -1569,6 +1571,8 @@ gtk_notebook_get_property (GObject         *object,
   GtkNotebook *notebook;
   GtkNotebookPrivate *priv;
 
+  GTK_OBJECT_WARN_UNSUPPORTED_PROPERTY (object, pspec);
+
   notebook = GTK_NOTEBOOK (object);
   priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
 
diff --git a/gtk/gtkobject.h b/gtk/gtkobject.h
index de6616b..eb37bfe 100644
--- a/gtk/gtkobject.h
+++ b/gtk/gtkobject.h
@@ -83,6 +83,47 @@ typedef enum
 #define GTK_OBJECT_SET_FLAGS(obj,flag)	  G_STMT_START{ (GTK_OBJECT_FLAGS (obj) |= (flag)); }G_STMT_END
 #define GTK_OBJECT_UNSET_FLAGS(obj,flag)  G_STMT_START{ (GTK_OBJECT_FLAGS (obj) &= ~(flag)); }G_STMT_END
 
+/**
+ * GtkParamFlags:
+ * @GTK_PARAM_DEPRECATED: the parameter is deprecated and will
+ *  be removed in a future version. A warning will be output
+ *  if it is used while GTK_ENABLE_DIAGNOSTIC is set.
+ *  Since 2.20
+ *
+ * See #GParamFlags for other flags.
+ */
+typedef enum
+{
+  GTK_PARAM_DEPRECATED        = 1 << G_PARAM_USER_SHIFT,
+} GtkParamFlags;
+
+/**
+ * GTK_OBJECT_WARN_UNSUPPORTED_PROPERTY:
+ * @object: the #GtkObject on which set_property() or get_property() was called
+ * @pspec: the #GParamSpec of the property
+ *
+ * This macro should be used to emit a standard warning if
+ * GTK_ENABLE_DIAGNOSTIC is set and unsupported properties are being
+ * modified. This includes the use of deprecated properties
+ * (#GTK_PARAM_DEPRECATED) and internal children (#GTK_WIDGET_COMPOSITE_CHILD).
+ *
+ * Since: 2.20.0
+ */
+#define GTK_OBJECT_WARN_UNSUPPORTED_PROPERTY(object, pspec) \
+G_STMT_START { \
+  if (g_getenv ("GTK_ENABLE_DIAGNOSTIC")) \
+    { \
+      if (pspec->flags & GTK_PARAM_DEPRECATED) \
+        g_warning ("The property %s::%s is deprecated and shouldn't be used " \
+                   "anymore. It will be removed in a future version.", \
+                   G_OBJECT_TYPE_NAME (object), pspec->name); \
+      else if (GTK_WIDGET_COMPOSITE_CHILD (object)) \
+        g_warning ("The property %s::%s belongs to a composited widget. " \
+                   "Modifying it is not supported.", \
+                   G_OBJECT_TYPE_NAME (object), pspec->name); \
+    } \
+} G_STMT_END
+
 typedef struct _GtkObjectClass	GtkObjectClass;
 
 
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 0a494c9..b6d6958 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -206,6 +206,8 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
   statusbar->has_resize_grip = TRUE;
 
   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);
@@ -221,6 +223,8 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
   gtk_container_add (GTK_CONTAINER (statusbar->frame), statusbar->label);
   gtk_widget_show (statusbar->label);
 
+  gtk_widget_pop_composite_child ();
+
   statusbar->seq_context_id = 1;
   statusbar->seq_message_id = 1;
   statusbar->messages = NULL;
