diff src/bar_keywords.c @ 1396:58f0b4586c8c

dnd fixes
author nadvornik
date Sun, 08 Mar 2009 12:42:23 +0000
parents e86d8facbdae
children 6ce1f7171d48
line wrap: on
line diff
--- a/src/bar_keywords.c	Sun Mar 08 11:32:12 2009 +0000
+++ b/src/bar_keywords.c	Sun Mar 08 12:42:23 2009 +0000
@@ -527,6 +527,7 @@
 					  GtkSelectionData *selection_data, guint info,
 					  guint time, gpointer data)
 {
+	PaneKeywordsData *pkd = data;
 	GtkTreePath *tpath = NULL;
         GtkTreeViewDropPosition pos;
 	GtkTreeModel *model;
@@ -578,6 +579,12 @@
 			return;
 			}
 
+		if (src_valid && keyword_compare(keyword_tree, &src_kw_iter, &dest_kw_iter) == 0)
+			{
+			/* can't move to itself */
+			return;
+			}
+
 		if ((pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE || pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER) &&
 		    !gtk_tree_model_iter_has_child(keyword_tree, &dest_kw_iter))
 			{
@@ -622,6 +629,7 @@
 			}
 		}
 	string_list_free(new_keywords);
+	bar_keyword_tree_sync(pkd);
 }
 
 static gint bar_pane_keywords_dnd_motion(GtkWidget *tree_view, GdkDragContext *context,