Index: gtkentrycompletion.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentrycompletion.c,v
retrieving revision 1.84
diff -u -r1.84 gtkentrycompletion.c
--- gtkentrycompletion.c	8 Oct 2006 05:06:50 -0000	1.84
+++ gtkentrycompletion.c	3 Dec 2006 10:23:07 -0000
@@ -60,7 +60,8 @@
   PROP_INLINE_COMPLETION,
   PROP_POPUP_COMPLETION,
   PROP_POPUP_SET_WIDTH,
-  PROP_POPUP_SINGLE_MATCH
+  PROP_POPUP_SINGLE_MATCH,
+  PROP_BROWSER_MODE
 };
 
 #define GTK_ENTRY_COMPLETION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionPrivate))
@@ -331,6 +332,14 @@
  							 TRUE,
  							 GTK_PARAM_READWRITE));
 
+  g_object_class_install_property (object_class,
+				   PROP_BROWSER_MODE,
+				   g_param_spec_boolean ("browser-mode",
+							 P_("Browser mode"),
+							 P_("Your description here"),
+							 FALSE,
+							 GTK_PARAM_READWRITE));
+
   g_type_class_add_private (object_class, sizeof (GtkEntryCompletionPrivate));
 }
 
@@ -364,6 +373,7 @@
   priv->popup_completion = TRUE;
   priv->popup_set_width = TRUE;
   priv->popup_single_match = TRUE;
+  priv->browser_mode = FALSE;
 
   /* completions */
   priv->filter_model = NULL;
@@ -378,6 +388,7 @@
   g_signal_connect (priv->tree_view, "motion_notify_event",
 		    G_CALLBACK (gtk_entry_completion_list_motion_notify),
 		    completion);
+
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), FALSE);
   gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->tree_view), TRUE);
 
@@ -505,6 +516,10 @@
 	priv->popup_single_match = g_value_get_boolean (value);
         break;
 
+      case PROP_BROWSER_MODE:
+        priv->browser_mode = g_value_get_boolean (value);
+        break;
+      
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
         break;
@@ -550,6 +565,10 @@
         g_value_set_boolean (value, gtk_entry_completion_get_popup_single_match (completion));
         break;
 
+      case PROP_BROWSER_MODE:
+        g_value_set_boolean (value, gtk_entry_completion_get_browser_mode (completion));
+        break;
+
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
         break;
@@ -1279,7 +1298,7 @@
 {
   GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
 
-  completion->priv->ignore_enter = FALSE; 
+  completion->priv->ignore_enter = FALSE;
   
   return FALSE;
 }
@@ -1554,6 +1573,40 @@
   return TRUE;
 }
 
+gboolean
+gtk_entry_completion_insert_completion (GtkEntryCompletion *completion,
+					GtkTreeModel       *model,
+					GtkTreeIter        *iter)
+{
+  gchar *str = NULL;
+
+  g_return_val_if_fail (GTK_IS_TREE_MODEL (model), FALSE);
+
+  if (completion->priv->text_column < 0)
+    return NULL;
+
+  gtk_tree_model_get (model, iter,
+		      completion->priv->text_column, &str,
+		      -1);
+
+  g_signal_handler_block (completion->priv->entry,
+			  completion->priv->changed_id);
+  g_signal_handler_block (completion->priv->entry,
+			  completion->priv->insert_text_id);
+
+  gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), str);
+  gtk_editable_set_position (GTK_EDITABLE (completion->priv->entry), -1);
+
+  g_signal_handler_unblock (completion->priv->entry,
+			    completion->priv->changed_id);
+  g_signal_handler_unblock (completion->priv->entry,
+			    completion->priv->insert_text_id);
+
+  g_free (str);
+
+  return TRUE;
+}
+
 /**
  * gtk_entry_completion_insert_prefix:
  * @completion: a #GtkEntryCompletion
@@ -1767,6 +1820,29 @@
   return completion->priv->popup_single_match;
 }
 
+void
+gtk_entry_completion_set_browser_mode (GtkEntryCompletion *completion,
+				       gboolean browser_mode)
+{
+  g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
+
+  browser_mode = browser_mode != FALSE;
+
+  if (completion->priv->browser_mode != browser_mode)
+    {
+      completion->priv->browser_mode = browser_mode;
+
+      g_object_notify (G_OBJECT (completion), "browser-mode");
+    }
+}
+
+gboolean
+gtk_entry_completion_get_browser_mode (GtkEntryCompletion *completion)
+{
+  g_return_val_if_fail (GTK_IS_ENTRY_COMPLETION (completion), FALSE);
+
+  return completion->priv->browser_mode;
+}
 
 #define __GTK_ENTRY_COMPLETION_C__
 #include "gtkaliasdef.c"
Index: gtkentryprivate.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentryprivate.h,v
retrieving revision 1.10
diff -u -r1.10 gtkentryprivate.h
--- gtkentryprivate.h	15 Aug 2006 18:52:11 -0000	1.10
+++ gtkentryprivate.h	3 Dec 2006 10:23:07 -0000
@@ -64,6 +64,10 @@
   guint popup_completion  : 1;
   guint popup_set_width   : 1;
   guint popup_single_match : 1;
+  guint browser_mode      : 1;
+
+  gchar *completion_prefix;
+
   GSource *check_completion_idle;
 };
 
Index: gtkentry.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentry.c,v
retrieving revision 1.325
diff -u -r1.325 gtkentry.c
--- gtkentry.c	16 Nov 2006 12:56:29 -0000	1.325
+++ gtkentry.c	3 Dec 2006 10:23:10 -0000
@@ -5580,6 +5580,23 @@
           path = gtk_tree_path_new_from_indices (completion->priv->current_selected, -1);
           gtk_tree_view_set_cursor (GTK_TREE_VIEW (completion->priv->tree_view),
                                     path, NULL, FALSE);
+          if (completion->priv->browser_mode)
+            {
+              GtkTreeIter iter;
+              GtkTreeModel *model = NULL;
+              GtkTreeSelection *sel;
+
+              if (completion->priv->completion_prefix == NULL)
+                {
+                  completion->priv->completion_prefix = g_strdup (gtk_entry_get_text (completion->priv->entry));
+                }
+
+              sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view));
+              if (!gtk_tree_selection_get_selected (sel, &model, &iter))
+                return FALSE;
+
+              gtk_entry_completion_insert_completion (completion, model, &iter);
+            }
         }
       else if (completion->priv->current_selected - matches >= 0)
         {
@@ -5599,6 +5616,13 @@
       _gtk_entry_reset_im_context (GTK_ENTRY (widget));
       _gtk_entry_completion_popdown (completion);
 
+      if (completion->priv->completion_prefix)
+        {
+          gtk_entry_set_text (completion->priv->entry, completion->priv->completion_prefix);
+          g_free (completion->priv->completion_prefix);
+          completion->priv->completion_prefix = NULL;
+        }
+
       return TRUE;
     }
   else if (event->keyval == GDK_Tab || 
@@ -5622,6 +5646,12 @@
       _gtk_entry_reset_im_context (GTK_ENTRY (widget));
       _gtk_entry_completion_popdown (completion);
 
+      if (completion->priv->completion_prefix)
+        {
+          g_free (completion->priv->completion_prefix);
+          completion->priv->completion_prefix = NULL;
+        }
+
       if (completion->priv->current_selected < matches)
         {
           GtkTreeIter iter;
@@ -5653,7 +5683,7 @@
               /* move the cursor to the end */
               gtk_editable_set_position (GTK_EDITABLE (widget), -1);
 
-             g_free (str);
+              g_free (str);
             }
 
           return TRUE;
@@ -5822,6 +5852,7 @@
       g_signal_connect (entry, "focus_out_event",
 			G_CALLBACK (accept_completion_callback), completion);
     }
+
   g_signal_connect (completion, "notify",
 		    G_CALLBACK (completion_changed), entry);
 }
