summaryrefslogtreecommitdiff
path: root/gtk/gtktreednd.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-09-09 23:13:39 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-09-09 23:13:39 +0000
commitb78691f0981303b2a84b26797a466954fad994b6 (patch)
treeae974183dc28c9bc10b9722c2fc04bce7a119d9b /gtk/gtktreednd.c
parent4b3e2d69a5c09303f0b7afd63aeaf49d798713f7 (diff)
downloadgtk+-b78691f0981303b2a84b26797a466954fad994b6.tar.gz
Big TreeView DnD fixage, makes drops on empty models work, makes TreeStore
Wed Sep 10 01:06:44 2003 Kristian Rietveld <kris@gtk.org> Big TreeView DnD fixage, makes drops on empty models work, makes TreeStore DnD work and gets rid of gtk-tree-model-drop-append. Related bugs #95362 and #113314. I don't want to touch this code ever again. * gtk/gtktreeprivate.h (GtkTreePrivate): add empty_view_drop field. * gtk/gtktreednd.c (gtk_tree_get_row_drag_data): add check for selection_data->length. * gtk/gtktreeview.c (struct DestRow), (dest_row_free), (set_dest_row), (get_dest_row): we don't store just the row ref anymore, but a struct with the row ref and additional info, (set_destination_row): handle drops on empty space and some style fixes, (get_logical_dest_row): also return path_down_mode/drop_append_mode flags, handle dropping childs on their new parents, rewrite drop append handling into something saner, (gtk_tree_view_drag_motion): show a "drop possible arrow" on empty spaces, (gtk_tree_view_drag_drop): updates for updated backend, (gtk_tree_view_drag_data_received): updates for updated backend, path down mode (treestore DnD) handling, (gtk_tree_view_set_drag_dest_row): set empty_view_drop flag, when we are trying to drop a row on an empty model, (gtk_tree_view_get_drag_dest_row): handle empty_view_drop flag. * gtk/gtkliststore.c (gtk_list_store_drag_data_received), (gtk_list_store_row_drop_possible): style and drop-append fixes. * gtk/gtktreestore.c (gtk_tree_store_drag_data_received): ditto.
Diffstat (limited to 'gtk/gtktreednd.c')
-rw-r--r--gtk/gtktreednd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtktreednd.c b/gtk/gtktreednd.c
index 7d9c13677e..0af3d00267 100644
--- a/gtk/gtktreednd.c
+++ b/gtk/gtktreednd.c
@@ -313,6 +313,9 @@ gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
if (selection_data->target != gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE))
return FALSE;
+ if (selection_data->length < 0)
+ return FALSE;
+
trd = (void*) selection_data->data;
if (tree_model)