Index: gtk/gtktextview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.322
diff -u -r1.322 gtktextview.c
--- gtk/gtktextview.c   1 Sep 2006 02:14:30 -0000       1.322
+++ gtk/gtktextview.c   10 Oct 2006 15:20:48 -0000
@@ -5663,6 +5663,9 @@
                                GdkEventMotion *event,
                                SelectionData  *data)
 {
+  if (!GTK_WIDGET_HAS_FOCUS (text_view))
+    gtk_text_view_end_selection_drag (text_view, NULL);
+
   if (data->granularity == SELECT_CHARACTERS)
     {
       move_mark_to_pointer_and_scroll (text_view, "insert");

