RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.187
diff -u -r1.187 gtktextview.c
--- gtk/gtktextview.c	2002/03/05 20:31:54	1.187
+++ gtk/gtktextview.c	2002/03/14 08:56:50
@@ -264,8 +264,7 @@
 static void     gtk_text_view_start_selection_drag   (GtkTextView        *text_view,
                                                       const GtkTextIter  *iter,
                                                       GdkEventButton     *event);
-static gboolean gtk_text_view_end_selection_drag     (GtkTextView        *text_view,
-                                                      GdkEventButton     *event);
+static gboolean gtk_text_view_end_selection_drag     (GtkTextView        *text_view);
 static void     gtk_text_view_start_selection_dnd    (GtkTextView        *text_view,
                                                       const GtkTextIter  *iter,
                                                       GdkEventMotion     *event);
@@ -3750,7 +3749,7 @@
       /* End the selection drag, otherwise we'd clear the new
        * word/line selection on button release
        */
-      gtk_text_view_end_selection_drag (text_view, event);
+      gtk_text_view_end_selection_drag (text_view);
 
       gtk_text_layout_get_iter_at_pixel (text_view->layout,
                                          &start,
@@ -3841,7 +3840,7 @@
           text_view->drag_start_y = -1;
         }
 
-      if (gtk_text_view_end_selection_drag (GTK_TEXT_VIEW (widget), event))
+      if (gtk_text_view_end_selection_drag (GTK_TEXT_VIEW (widget)))
         return TRUE;
       else if (text_view->just_selected_element)
         {
@@ -5097,7 +5096,7 @@
 
 /* returns whether we were really dragging */
 static gboolean
-gtk_text_view_end_selection_drag (GtkTextView *text_view, GdkEventButton *event)
+gtk_text_view_end_selection_drag (GtkTextView *text_view)
 {
   if (text_view->selection_drag_handler == 0)
     return FALSE;
@@ -5304,7 +5303,7 @@
         }
       
       gtk_text_view_stop_cursor_blink (text_view);
-      gtk_text_view_end_selection_drag (text_view, NULL);
+      gtk_text_view_end_selection_drag (text_view);
 
       g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->layout),
                                             invalidated_handler, text_view);
@@ -6379,6 +6378,13 @@
                         GdkEventButton *event)
 {
   PopupInfo *info = g_new (PopupInfo, 1);
+
+  /* End the selection drag, otherwise we'd might miss the
+   * left button release to stop the drag since the menu
+   * catches the left button releases. Also the correct
+   * thing to do semantically.
+   */
+  gtk_text_view_end_selection_drag (text_view);
 
   /* In order to know what entries we should make sensitive, we
    * ask for the current targets of the clipboard, and when
