Exemple #1
0
static gboolean on_drag_drop(GtkWidget *dest_widget,
                               GdkDragContext *drag_context,
                               gint x,
                               gint y,
                               guint time,
                               FmFolderView* fv)
{
    gboolean ret = FALSE;
    GdkAtom target = gtk_drag_dest_find_target(dest_widget, drag_context, NULL);
    if(target != GDK_NONE)
        ret = fm_dnd_dest_drag_drop(fv->dnd_dest, drag_context, target, x, y, time);
    return ret;
}
Exemple #2
0
static gboolean on_drag_drop ( GtkWidget *dest_widget,
                    GdkDragContext *drag_context, gint x, gint y, guint time)
{
    FmPlacesView* view = FM_PLACES_VIEW(dest_widget);
    GtkTreeViewDropPosition pos;
    gboolean ret = FALSE;

    GdkAtom target = gtk_drag_dest_find_target(dest_widget, drag_context, NULL);
    /* this is to reorder bookmark */
    if(target == gdk_atom_intern_static_string("GTK_TREE_MODEL_ROW"))
    {
        gtk_drag_get_data(dest_widget, drag_context, target, time);
        ret = TRUE;
    }
    else
    {
        /* try FmDndDest */
        ret = fm_dnd_dest_drag_drop(view->dnd_dest, drag_context, target, time);
        if(!ret)
            gtk_drag_finish(drag_context, FALSE, FALSE, time);
    }
    return ret;
}