diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2013-04-10 15:38:45 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2013-04-15 18:43:16 -0400 |
commit | 62d7d396761c1b5e3ce4f684d6ca630c4e0ba59f (patch) | |
tree | 0e1fb3543a5d5e9da6a8ef51248b409641d50e6f | |
parent | 50d13fa5e2a7c74c74047f8f895a154c21484650 (diff) | |
download | nautilus-62d7d396761c1b5e3ce4f684d6ca630c4e0ba59f.tar.gz |
dnd: only allow the desktop as target for special desktop items
When a special desktop item (Home, Trash and the volumes shortcut) is
dragged, only the desktop itself is a valid destination target.
-rw-r--r-- | libnautilus-private/nautilus-dnd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c index 5c175f2ad..dcb990fe0 100644 --- a/libnautilus-private/nautilus-dnd.c +++ b/libnautilus-private/nautilus-dnd.c @@ -461,6 +461,13 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context, dropped_file = ((NautilusDragSelectionItem *)items->data)->file; target_file = nautilus_file_get_existing_by_uri (target_uri_string); + if (eel_uri_is_desktop (dropped_uri) && + !eel_uri_is_desktop (target_uri_string)) { + /* Desktop items only move on the desktop */ + *action = 0; + return; + } + /* * Check for trash URI. We do a find_directory for any Trash directory. * Passing 0 permissions as gnome-vfs would override the permissions |