After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 720390 - Type=Link Desktop file issue
Type=Link Desktop file issue
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Desktop
3.10.x
Other OpenBSD
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 720485 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-12-13 13:17 UTC by Antoine Jacoutot
Modified: 2015-02-21 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix dnd issues of Type=Link desktop files (1.89 KB, patch)
2014-12-27 16:22 UTC, Nelson Benitez
reviewed Details | Review
Fix dnd issues of Type=Link desktop files v2 (2.47 KB, patch)
2015-01-06 20:41 UTC, Nelson Benitez
committed Details | Review

Description Antoine Jacoutot 2013-12-13 13:17:55 UTC
Hi.

When having a desktop file of type "Link" and using nautilus to move it to another directory, it seems to copy the entire target of link instead of just moving the symlink.
While I can live with this behavior, there is a big drawback in Classic mode in that if you want to move your icon on the Desktop, then instead it will start to copy the entire content of the linked directory.

Here's an example of the dot.desktop file I created on my Desktop:

[Desktop Entry]
Name=Data
Encoding=UTF-8
Type=Link
Icon=folder-remote
URL=file:///data/

It will appear as "Data" on my Desktop; moving it anywhere on the Desktop will start a copy of /data into a new directory (obviously called "data").
Comment 1 António Fernandes 2013-12-16 11:02:09 UTC
*** Bug 720485 has been marked as a duplicate of this bug. ***
Comment 2 Norman Smith 2014-01-24 14:04:43 UTC
If a Desktop Entry file of Type 2 (Link) is Dragged and Dropped the item referenced by the URL= entry in the .desktop file is moved or copied not the .desktop file itself.  This can lead to near disastrous results when moving several items at once from one folder to another.  This behaviour is inconsistent with the handling of all other Desktop Entry types.  This is a bad bug.
Comment 3 gaele 2014-07-07 20:12:09 UTC
Several people on Ubuntu report this issue: 
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1278437
Comment 4 Marty Fried 2014-07-19 14:51:05 UTC
I can confirm this bug.  I notice it with both Firefox and Chrome, when I drag from the addressbar to the desktop to create a link.  This works normally, but then I often want to move it on the desktop to a different location. I was very surprised to find that it created a new icon, which does not even work.  Very unexpected and annoying.

I'm using a fully-updated Ubuntu 14.04 with Gnome Fallback desktoop.
Comment 5 Matthias Meier 2014-12-18 07:29:14 UTC
This annoying bug still exists on nautilus 3.14.2  (eg. on fedora 21 or ubuntu 14.10)

I'm not sure if everybody have this problem or if it is caused by a malformed setting on my system. Unfortunately I have no idea where to search :-(
Comment 6 Antoine Jacoutot 2014-12-18 07:52:48 UTC
> I'm not sure if everybody have this problem or if it is caused by a malformed
> setting on my system. Unfortunately I have no idea where to search :-(

It's 100% reproducible on all machines I have that run GNOME; independent of the operating system.
Comment 7 Nelson Benitez 2014-12-27 16:22:42 UTC
Created attachment 293378 [details] [review]
Fix dnd issues of Type=Link desktop files

The bug is present both in list view and icon view. The problem was using activation uri of Type=Link desktop files when creating the NautilusDragSelectionItem items for dnd. 

This patch fixes it for me, pasting here the commit message:

    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.
Comment 8 Cosimo Cecchi 2014-12-28 05:35:37 UTC
Review of attachment 293378 [details] [review]:

Is there any reason to keep the activation uri code path then?

::: libnautilus-private/nautilus-canvas-dnd.c
@@ +238,2 @@
 	uri = nautilus_canvas_container_get_icon_uri (container, icon);
+	if (!eel_uri_is_desktop (uri) && !g_str_has_suffix (uri, ".desktop")) {

I'd rather this used nautilus_file_is_nautilus_link() too
Comment 9 Nelson Benitez 2015-01-06 20:40:45 UTC
(In reply to comment #8)
> Review of attachment 293378 [details] [review]:
> 
> Is there any reason to keep the activation uri code path then?

I don't know the original motivation for the activation uri code path, so I'm not confident removing it.

> 
> ::: libnautilus-private/nautilus-canvas-dnd.c
> @@ +238,2 @@
>      uri = nautilus_canvas_container_get_icon_uri (container, icon);
> +    if (!eel_uri_is_desktop (uri) && !g_str_has_suffix (uri, ".desktop")) {
> 
> I'd rather this used nautilus_file_is_nautilus_link() too

I thought this was not possible from nautilus-canvas-dnd.c but was wrong. I'm attaching a new patch with this fixed.
Comment 10 Nelson Benitez 2015-01-06 20:41:52 UTC
Created attachment 293976 [details] [review]
Fix dnd issues of Type=Link desktop files v2
Comment 11 Cosimo Cecchi 2015-01-07 01:01:42 UTC
Review of attachment 293976 [details] [review]:

Looks good, thanks.
Comment 12 Cosimo Cecchi 2015-01-07 01:03:09 UTC
Review of attachment 293976 [details] [review]:

Looks good, thanks.
Comment 13 Cosimo Cecchi 2015-01-07 01:03:09 UTC
Comment on attachment 293976 [details] [review]
Fix dnd issues of Type=Link desktop files v2

Looks good, thanks.
Comment 14 Nelson Benitez 2015-01-07 11:13:36 UTC
Comment on attachment 293976 [details] [review]
Fix dnd issues of Type=Link desktop files v2

Committed.
Comment 15 xabiorama 2015-02-19 22:49:46 UTC
It is fixed in any version of nautilus?
Comment 16 Nelson Benitez 2015-02-21 12:53:41 UTC
(In reply to xabiorama from comment #15)
> It is fixed in any version of nautilus?

Nautilus version 3.15.4 onwards.