[nautilus] Don't get drag data in list mode if we don't support the target.
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus] Don't get drag data in list mode if we don't support the target.
- Date: Mon, 2 Nov 2009 17:10:02 +0000 (UTC)
commit 6613262f4e6d40d153299d7fd4726210268a2a53
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Nov 2 18:09:15 2009 +0100
Don't get drag data in list mode if we don't support the target.
This fixes bug #600183.
libnautilus-private/nautilus-tree-view-drag-dest.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/libnautilus-private/nautilus-tree-view-drag-dest.c b/libnautilus-private/nautilus-tree-view-drag-dest.c
index 09ce442..20646ef 100644
--- a/libnautilus-private/nautilus-tree-view-drag-dest.c
+++ b/libnautilus-private/nautilus-tree-view-drag-dest.c
@@ -242,7 +242,7 @@ clear_drag_dest_row (NautilusTreeViewDragDest *dest)
set_widget_highlight (dest, FALSE);
}
-static void
+static gboolean
get_drag_data (NautilusTreeViewDragDest *dest,
GdkDragContext *context,
guint32 time)
@@ -252,15 +252,22 @@ get_drag_data (NautilusTreeViewDragDest *dest,
target = gtk_drag_dest_find_target (GTK_WIDGET (dest->details->tree_view),
context,
NULL);
+
+ if (target == GDK_NONE) {
+ return FALSE;
+ }
+
if (target == gdk_atom_intern (NAUTILUS_ICON_DND_XDNDDIRECTSAVE_TYPE, FALSE) &&
!dest->details->drop_occurred) {
dest->details->drag_type = NAUTILUS_ICON_DND_XDNDDIRECTSAVE;
dest->details->have_drag_data = TRUE;
- return;
+ return TRUE;
}
gtk_drag_get_data (GTK_WIDGET (dest->details->tree_view),
context, target, time);
+
+ return TRUE;
}
static void
@@ -455,6 +462,7 @@ drag_motion_callback (GtkWidget *widget,
GtkTreeViewDropPosition pos;
GdkWindow *bin_window;
guint action;
+ gboolean res = TRUE;
dest = NAUTILUS_TREE_VIEW_DRAG_DEST (data);
@@ -463,8 +471,13 @@ drag_motion_callback (GtkWidget *widget,
if (!dest->details->have_drag_data) {
- get_drag_data (dest, context, time);
+ res = get_drag_data (dest, context, time);
}
+
+ if (!res) {
+ return FALSE;
+ }
+
drop_path = get_drop_path (dest, path);
action = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]