GNOME Bugzilla – Bug 92768
Texts DnDed to its original places just disappeared
Last modified: 2004-12-22 21:47:04 UTC
In GtkTreeView, text DnDed to its original places just disappeared. To reproduce the steps are: 1. Start gedit. 2. Type some text say "abc.." 3. Select the entire text just typed. 4. Drag the text backwards and release the mouse. 5. The text typed disappears.
Oops sorry its GtkTextView and not GtkTreeview as mentioned in the description. In gtktreeview.c:gtk_text_view_drag_motion, the place where we check whether we are in the selection should be done as follows else if (gtk_text_buffer_get_selection_bounds (get_buffer (text_view), &start, &end) && - gtk_text_iter_in_range (&newplace, &start, &end)) + gtk_text_iter_compare (&newplace, &start) >= 0 && + gtk_text_iter_compare (&newplace, &end) <= 0) This because the end iter is also a part of the selection and gtk_text_iter_in_range only checks for end < 0 and not end <= 0. Attaching a patch for the same soon..
Created attachment 10961 [details] [review] Proposed patch
This patch looks fine to commit on 2-0 and HEAD branches, thanks.
Committed the patch to both cvs HEAD and gtk-2-0 branch. Marking the bug as FIXED. Thanks.
*** Bug 76676 has been marked as a duplicate of this bug. ***