After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 92768 - Texts DnDed to its original places just disappeared
Texts DnDed to its original places just disappeared
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.0.x
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
: 76676 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-09-08 07:41 UTC by Shivram U
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.51 KB, patch)
2002-09-08 07:58 UTC, Shivram U
none Details | Review

Description Shivram U 2002-09-08 07:41: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.
Comment 1 Shivram U 2002-09-08 07:45:59 UTC
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..
Comment 2 Shivram U 2002-09-08 07:58:29 UTC
Created attachment 10961 [details] [review]
Proposed patch
Comment 3 Havoc Pennington 2002-09-08 16:40:20 UTC
This patch looks fine to commit on 2-0 and HEAD branches, thanks.
Comment 4 Shivram U 2002-09-09 10:38:14 UTC
Committed the patch to both cvs HEAD and gtk-2-0 branch.
Marking the bug as FIXED. Thanks.
Comment 5 Matthias Clasen 2002-12-26 20:19:53 UTC
*** Bug 76676 has been marked as a duplicate of this bug. ***