diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 1103ce2..4a28955 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -2777,7 +2777,10 @@ gtk_menu_size_allocate (GtkWidget     *widget,
   priv->requested_height = (2 * border_width) + padding.top + padding.bottom;
   for (i = 0; i < priv->heights_length; i++)
     priv->requested_height += priv->heights[i];
-
+  
+  /* the height might have changed if new menu items were inserted */
+  allocation->height = priv->requested_height;
+  
   x = border_width + padding.left;
   y = border_width + padding.top;
   width = allocation->width - (2 * border_width) -
@@ -2785,9 +2788,6 @@ gtk_menu_size_allocate (GtkWidget     *widget,
   height = allocation->height - (2 * border_width) -
     padding.top - padding.bottom;
 
-  if (menu_shell->priv->active)
-    gtk_menu_scroll_to (menu, priv->scroll_offset);
-
   if (!priv->tearoff_active)
     {
       GtkBorder arrow_border;
@@ -2803,6 +2803,8 @@ gtk_menu_size_allocate (GtkWidget     *widget,
 
   if (gtk_widget_get_realized (widget))
     {
+      /* Reposition the menu in case its size has changed. */
+      gtk_menu_position(menu, FALSE);
       gdk_window_move_resize (gtk_widget_get_window (widget),
                               allocation->x, allocation->y,
                               allocation->width, allocation->height);
