[nautilus/gnome-3-8] 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/gnome-3-8] dnd: only allow the desktop as target for special desktop items
- Date: Tue, 16 Apr 2013 00:23:11 +0000 (UTC)
commit 62d7d396761c1b5e3ce4f684d6ca630c4e0ba59f
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 file changed, 7 insertions(+)
---
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]