summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2013-04-10 15:38:45 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2013-04-10 15:38:45 -0400
commite0b864eed48c71b64e177507caa435df6ccba158 (patch)
tree0b49108dc3b161cb934921228b6b2fe3d6982611
parenta07820780a1e6649496e274647102eca001e2a99 (diff)
downloadnautilus-e0b864eed48c71b64e177507caa435df6ccba158.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.c7
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