+static void
+gtk_bin_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ GtkBin *bin = GTK_BIN (widget);
+ GtkBinPrivate *priv = bin->priv;
+
+ gtk_widget_set_allocation (widget, allocation);
+
+ if (priv->child && gtk_widget_get_visible (priv->child))
+ {
+ GtkAllocation child_allocation;
+ gint border_width = gtk_bin_get_effective_border_width (bin);
+
+ child_allocation.x = allocation->x + border_width;
+ child_allocation.y = allocation->y + border_width;
+ child_allocation.width = allocation->width - 2 * border_width;
+ child_allocation.height = allocation->height - 2 * border_width;
+
+ gtk_widget_size_allocate (priv->child, &child_allocation);
+ }
+}