Index: gtk/gtkentry.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentry.c,v
retrieving revision 1.322
diff -u -3 -p -r1.322 gtkentry.c
--- gtk/gtkentry.c	1 Sep 2006 02:14:30 -0000	1.322
+++ gtk/gtkentry.c	1 Sep 2006 14:41:17 -0000
@@ -1620,8 +1620,11 @@ gtk_entry_button_press (GtkWidget      *
 	  
 	  if (tmp_pos > sel_start && tmp_pos < sel_end)
 	    {
-	      /* Truncate current selection */
-	      gtk_entry_set_positions (entry, tmp_pos, -1);
+	      /* Truncate current selection, but keep it as big as possible */
+	      if (tmp_pos - sel_start > sel_end - tmp_pos)
+		gtk_entry_set_positions (entry, sel_start, tmp_pos);
+	      else
+		gtk_entry_set_positions (entry, tmp_pos, sel_end);
 	    }
 	  else
 	    {
@@ -3519,7 +3522,7 @@ gtk_entry_find_position (GtkEntry *entry
   PangoLayoutLine *line;
   gint index;
   gint pos;
-  gboolean trailing;
+  gint trailing;
   const gchar *text;
   gint cursor_index;
   
