--- ../gtkentrycompletion.c	2007-02-15 09:29:34.000000000 +0200
+++ ../gtkentrycompletion.c	2007-02-15 09:26:52.000000000 +0200
@@ -147,8 +147,10 @@
 gtk_entry_completion_class_init (GtkEntryCompletionClass *klass)
 {
   GObjectClass *object_class;
+  GtkWidgetClass *widget_class;
 
   object_class = (GObjectClass *)klass;
+  widget_class = (GtkWidgetClass *)klass;
 
   object_class->set_property = gtk_entry_completion_set_property;
   object_class->get_property = gtk_entry_completion_get_property;
@@ -331,6 +333,24 @@
  							 TRUE,
  							 GTK_PARAM_READWRITE));
 
+  /**
+   * GtkEntryCompletion::max-items:
+   *
+   * Determines the maximum number of items that will be shown at the same time in the
+   * entry completion popup (without taking into account the completion actions). This
+   * variable can be used to control the maximum possible height of the popup.
+   *
+   * Since: 2.12
+   */
+  gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_int ("max-items",
+							     P_("Max items"),
+							     P_("Maximum number of items to be shown at the same time"),
+							     0,
+							     G_MAXINT,
+							     15,
+							     GTK_PARAM_READWRITE));
+
   g_type_class_add_private (object_class, sizeof (GtkEntryCompletionPrivate));
 }
 
@@ -1296,7 +1316,7 @@
   GtkRequisition entry_req;
   GtkTreePath *path;
   gboolean above;
-  gint width;
+  gint width, max_items;
 
   if (!completion->priv->entry->window)
     return FALSE;
@@ -1306,15 +1326,17 @@
 
   matches = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (completion->priv->filter_model), NULL);
 
-  items = MIN (matches, max_items);
 
   gtk_tree_view_column_cell_get_size (completion->priv->column, NULL,
                                       NULL, NULL, NULL, &height);
 
   gtk_widget_style_get (GTK_WIDGET (completion->priv->tree_view),
                         "vertical-separator", &vertical_separator,
+			"max-items", &max_items,
                         NULL);
 
+  items = MIN (matches, max_items);
+
   height += vertical_separator;
   
   gtk_widget_realize (completion->priv->tree_view);
