Commit fa1211f8 authored by Nelson Benítez León's avatar Nelson Benítez León

dnd: fix dnd issues with Type=Link desktop files

When creating NautilusDragSelectionItem items for dnd
make sure we use regular uri (instead of activation uri)
for Type=Link desktop files.

Other types of desktop files were not affected by this bug
as their regular uri and activation uri are usually the same.

Fixes bug 720390
parent cc493d64
......@@ -224,6 +224,7 @@ icon_get_data_binder (NautilusCanvasIcon *icon, gpointer data)
EelIRect widget_rect;
char *uri;
NautilusCanvasContainer *container;
NautilusFile *file;
context = (CanvasGetDataBinderContext *)data;
......@@ -236,13 +237,15 @@ icon_get_data_binder (NautilusCanvasIcon *icon, gpointer data)
canvas_rect_world_to_widget (EEL_CANVAS (container), &world_rect, &widget_rect);
uri = nautilus_canvas_container_get_icon_uri (container, icon);
if (!eel_uri_is_desktop (uri)) {
file = nautilus_file_get_by_uri (uri);
if (!eel_uri_is_desktop (uri) && !nautilus_file_is_nautilus_link (file)) {
g_free (uri);
uri = nautilus_canvas_container_get_icon_activation_uri (container, icon);
if (uri == NULL) {
g_warning ("no URI for one of the iterated icons");
nautilus_file_unref (file);
return TRUE;
......@@ -262,6 +265,7 @@ icon_get_data_binder (NautilusCanvasIcon *icon, gpointer data)
g_free (uri);
nautilus_file_unref (file);
return TRUE;
......@@ -464,7 +464,11 @@ item_get_data_binder (GtkTreeModel *model,
uri = nautilus_file_get_activation_uri (file);
if (nautilus_file_is_nautilus_link (file)) {
uri = nautilus_file_get_uri (file);
} else {
uri = nautilus_file_get_activation_uri (file);
nautilus_file_unref (file);
/* pass the uri, mouse-relative x/y and icon width/height */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment