static gboolean
drag_motion_callback (GtkWidget *widget,
                      GdkDragContext *context,
                      int x,
                      int y,
                      guint32 time,
                      gpointer data)
{
    NautilusTreeViewDragDest *dest;
    GtkTreePath *path;
    GtkTreePath *drop_path, *old_drop_path;
    GtkTreeViewDropPosition pos;
    GdkWindow *bin_window;
    guint action;
    gboolean res = TRUE;

    dest = NAUTILUS_TREE_VIEW_DRAG_DEST (data);

    gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
                                       x, y, &path, &pos);
    if (pos == GTK_TREE_VIEW_DROP_BEFORE ||
            pos == GTK_TREE_VIEW_DROP_AFTER) {
        gtk_tree_path_free (path);
        path = NULL;
    }

    if (!dest->details->have_drag_data) {
        res = get_drag_data (dest, context, time);
    }

    if (!res) {
        return FALSE;
    }

    drop_path = get_drop_path (dest, path);

    action = 0;
    bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
    if (bin_window != NULL) {
        int bin_x, bin_y;
        gdk_window_get_position (bin_window, &bin_x, &bin_y);
        if (bin_y <= y) {
            /* ignore drags on the header */
            action = get_drop_action (dest, context, drop_path);
        }
    }

    gtk_tree_view_get_drag_dest_row (GTK_TREE_VIEW (widget), &old_drop_path,
                                     NULL);

    if (action) {
        set_drag_dest_row (dest, drop_path);
        check_hover_expand_timer (dest, path, drop_path, old_drop_path);
    } else {
        clear_drag_dest_row (dest);
        remove_hover_timer (dest);
        remove_expand_timer (dest);
    }

    if (path) {
        gtk_tree_path_free (path);
    }

    if (drop_path) {
        gtk_tree_path_free (drop_path);
    }

    if (old_drop_path) {
        gtk_tree_path_free (old_drop_path);
    }

    if (dest->details->scroll_id == 0) {
        dest->details->scroll_id =
            g_timeout_add (150,
                           scroll_timeout,
                           dest->details->tree_view);
    }

    gdk_drag_status (context, action, time);

    return TRUE;
}
static gboolean
drag_motion_callback (GtkWidget *widget,
		      GdkDragContext *context,
		      int x,
		      int y,
		      guint32 time,
		      gpointer data)
{
	NemoTreeViewDragDest *dest;
	GtkTreePath *path;
	GtkTreePath *drop_path, *old_drop_path;
	GtkTreeModel *model;
	GtkTreeIter drop_iter;
	GtkTreeViewDropPosition pos;
	GdkWindow *bin_window;
	guint action;
	gboolean res = TRUE;

	dest = NEMO_TREE_VIEW_DRAG_DEST (data);

	gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
					   x, y, &path, &pos);
	

	if (!dest->details->have_drag_data) {
		res = get_drag_data (dest, context, time);
	}

	if (!res) {
		return FALSE;
	}

	drop_path = get_drop_path (dest, path);
	
	action = 0;
	bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
	if (bin_window != NULL) {
		int bin_x, bin_y;
		gdk_window_get_position (bin_window, &bin_x, &bin_y);
		if (bin_y <= y) {
			/* ignore drags on the header */
			action = get_drop_action (dest, context, drop_path);
		}
	}

	gtk_tree_view_get_drag_dest_row (GTK_TREE_VIEW (widget), &old_drop_path,
					 NULL);
	
	if (action) {
		set_drag_dest_row (dest, drop_path);
		model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
		if (drop_path == NULL || (old_drop_path != NULL &&
		    gtk_tree_path_compare (old_drop_path, drop_path) != 0)) {
			remove_expand_timeout (dest);
		}
		if (dest->details->expand_id == 0 && drop_path != NULL) {
			gtk_tree_model_get_iter (model, &drop_iter, drop_path);
			if (gtk_tree_model_iter_has_child (model, &drop_iter)) {
				dest->details->expand_id = g_timeout_add_seconds (HOVER_EXPAND_TIMEOUT,
									  expand_timeout,
									  dest->details->tree_view);
			}
		}
	} else {
		clear_drag_dest_row (dest);
		remove_expand_timeout (dest);
	}
	
	if (path) {
		gtk_tree_path_free (path);
	}
	
	if (drop_path) {
		gtk_tree_path_free (drop_path);
	}
	
	if (old_drop_path) {
		gtk_tree_path_free (old_drop_path);
	}
	
	if (dest->details->scroll_id == 0) {
		dest->details->scroll_id = 
			g_timeout_add (150, 
				       scroll_timeout, 
				       dest->details->tree_view);
	}

	gdk_drag_status (context, action, time);

	return TRUE;
}