[nautilus] dnd: only allow the desktop as target for special desktop items
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] dnd: only allow the desktop as target for special desktop items
- Date: Wed, 10 Apr 2013 21:52:46 +0000 (UTC)
commit e0b864eed48c71b64e177507caa435df6ccba158
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Apr 10 15:38:45 2013 -0400
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.
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 5c175f2..dcb990f 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]