Skip to content
Snippets Groups Projects
Commit 71bf3bc6 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #10736: calltree: validate path when we are dropping into an element

parent 9141650b
Branches
Tags
No related merge requests found
......@@ -1246,6 +1246,16 @@ render_drop(GtkTreeModel *model, GtkTreePath *dest_path, GtkTreeViewDropPosition
return FALSE;
}
gboolean result;
switch (dest_pos) {
case GTK_TREE_VIEW_DROP_BEFORE:
DEBUG("DROP_BEFORE, detaching if appropriate");
result = try_detach(model, source_iter, &dest_iter);
break;
case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
/* fallthrough */
case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
DEBUG("DROP_INTO");
GtkTreePath *source_path = gtk_tree_model_get_path(model, source_iter);
if (!gtk_tree_path_compare(source_path, dest_path)) {
ERROR("invalid drop: source and dest are same");
......@@ -1262,16 +1272,6 @@ render_drop(GtkTreeModel *model, GtkTreePath *dest_path, GtkTreeViewDropPosition
}
gtk_tree_path_free(source_path);
gboolean result;
switch (dest_pos) {
case GTK_TREE_VIEW_DROP_BEFORE:
DEBUG("DROP_BEFORE, detaching if appropriate");
result = try_detach(model, source_iter, &dest_iter);
break;
case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
/* fallthrough */
case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
DEBUG("DROP_INTO");
result = handle_drop_into(model, source_iter, &dest_iter);
break;
case GTK_TREE_VIEW_DROP_AFTER:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment