summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wehner <martin.wehner@gmail.com>2006-04-10 20:09:36 +0000
committerMartin Wehner <mwehner@src.gnome.org>2006-04-10 20:09:36 +0000
commite218e5fff36eb9c1f9b302057394e6d83195dcca (patch)
tree3ddc3309357c4929ddaf15f6e4bcbff10d21245c
parent52fe72da183dc1a72f9644607a549bf2cb6d4e5d (diff)
downloadnautilus-e218e5fff36eb9c1f9b302057394e6d83195dcca.tar.gz
Determine drop target by iterating through drop container target list
2006-04-10 Martin Wehner <martin.wehner@gmail.com> * libnautilus-private/nautilus-icon-dnd.c: (get_data_on_first_target_we_support): Determine drop target by iterating through drop container target list instead of drag context DND list. (#337588) Patch from Christian Neumair <chris@gnome-de.org>
-rw-r--r--ChangeLog9
-rw-r--r--libnautilus-private/nautilus-icon-dnd.c38
2 files changed, 27 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c73f90b0..e5f56064c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2006-04-10 Martin Wehner <martin.wehner@gmail.com>
+ * libnautilus-private/nautilus-icon-dnd.c:
+ (get_data_on_first_target_we_support):
+ Determine drop target by iterating through drop container
+ target list instead of drag context DND list. (#337588)
+
+ Patch from Christian Neumair <chris@gnome-de.org>
+
+2006-04-10 Martin Wehner <martin.wehner@gmail.com>
+
* po/LINGUAS: New file listing all supported languages.
* configure.in: Use po/LINGUAS instead of including all languages
diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c
index 0d611a3fe..fbce36205 100644
--- a/libnautilus-private/nautilus-icon-dnd.c
+++ b/libnautilus-private/nautilus-icon-dnd.c
@@ -371,8 +371,8 @@ nautilus_icon_container_dropped_icon_feedback (GtkWidget *widget,
static void
get_data_on_first_target_we_support (GtkWidget *widget, GdkDragContext *context, guint32 time)
{
- GList *target;
GtkTargetList *list;
+ GdkAtom target;
if (drop_types_list == NULL) {
drop_types_list = gtk_target_list_new (drop_types,
@@ -390,30 +390,28 @@ get_data_on_first_target_we_support (GtkWidget *widget, GdkDragContext *context,
} else {
list = drop_types_list;
}
-
- for (target = context->targets; target != NULL; target = target->next) {
+
+ target = gtk_drag_dest_find_target (widget, context, list);
+ if (target != GDK_NONE) {
guint info;
- GdkAtom target_atom = GDK_POINTER_TO_ATOM (target->data);
NautilusDragInfo *drag_info;
+ gboolean found;
drag_info = &(NAUTILUS_ICON_CONTAINER (widget)->details->dnd_info->drag_info);
- if (gtk_target_list_find (list,
- target_atom,
- &info)) {
- /* Don't get_data for rootwindow drops unless it's the actual drop */
- if (info == NAUTILUS_ICON_DND_ROOTWINDOW_DROP &&
- !drag_info->drop_occured) {
- /* We can't call get_data here, because that would
- make the source execute the rootwin action */
- drag_info->got_drop_data_type = TRUE;
- drag_info->data_type = NAUTILUS_ICON_DND_ROOTWINDOW_DROP;
- } else {
- gtk_drag_get_data (GTK_WIDGET (widget), context,
- target_atom,
- time);
- }
- break;
+ found = gtk_target_list_find (list, target, &info);
+ g_assert (found);
+
+ /* Don't get_data for rootwindow drops unless it's the actual drop */
+ if (info == NAUTILUS_ICON_DND_ROOTWINDOW_DROP &&
+ !drag_info->drop_occured) {
+ /* We can't call get_data here, because that would
+ make the source execute the rootwin action */
+ drag_info->got_drop_data_type = TRUE;
+ drag_info->data_type = NAUTILUS_ICON_DND_ROOTWINDOW_DROP;
+ } else {
+ gtk_drag_get_data (GTK_WIDGET (widget), context,
+ target, time);
}
}
}