Index: /home/dkasak/.workspace/gtk+/gtk/gtkcomboboxentry.c
===================================================================
--- /home/dkasak/.workspace/gtk+/gtk/gtkcomboboxentry.c	(revision 20106)
+++ /home/dkasak/.workspace/gtk+/gtk/gtkcomboboxentry.c	(working copy)
@@ -287,17 +287,54 @@
 
 static void
 gtk_combo_box_entry_contents_changed (GtkEntry *entry,
-                                      gpointer  user_data)
+                                       gpointer  user_data)
 {
-  GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
+   GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
+
+   GtkTreeModel *model;
+   GtkTreeIter iter;
+   const gchar * str;
+   gboolean have_iter;
+   gboolean found_match = FALSE;
+   gint text_column;
+
+   g_signal_handlers_block_by_func (combo_box,
+                                    gtk_combo_box_entry_active_changed,
+                                    NULL);
+   
+   /* Try to find a match in the combo's model with what the user has just typed.
+    * If we find one, then set the active iter in the combo so it actually registers
+    * a match. */
+   
+   str = gtk_entry_get_text (entry);
+   
+   text_column = gtk_combo_box_entry_get_text_column (GTK_COMBO_BOX_ENTRY (combo_box));
+   model = gtk_combo_box_get_model(combo_box);
+   have_iter = gtk_tree_model_get_iter_first(model, &iter);
+   
+   GValue value = {0, };
+   
+   while (have_iter)
+     {
+       gtk_tree_model_get_value (model, &iter, text_column, &value);
+       found_match = g_str_equal (str, g_value_get_string (&value));
+       g_value_unset (&value);
+
+       if (found_match)
+         {
+           gtk_combo_box_set_active_iter (combo_box, &iter);
+           break;
+         }
+
+       have_iter = gtk_tree_model_iter_next (model, &iter);
+     }
 
-  g_signal_handlers_block_by_func (combo_box,
-                                   gtk_combo_box_entry_active_changed,
-                                   NULL);
-  gtk_combo_box_set_active (combo_box, -1);
-  g_signal_handlers_unblock_by_func (combo_box,
-                                     gtk_combo_box_entry_active_changed,
-                                     NULL);
+   if (!found_match)
+     gtk_combo_box_set_active (combo_box, -1);
+
+   g_signal_handlers_unblock_by_func (combo_box,
+                                      gtk_combo_box_entry_active_changed,
+                                      NULL);
 }
 
 /* public API */

