summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-dnd.c
diff options
context:
space:
mode:
authorChristian Neumair <cneumair@gnome.org>2008-07-14 22:28:42 +0000
committerChristian Neumair <cneumair@src.gnome.org>2008-07-14 22:28:42 +0000
commit82d2b78b236123fee80ae9c0b5170924355e12c7 (patch)
treeeb88ce770e0a807431506dc9b1c5689552e34b0d /libnautilus-private/nautilus-dnd.c
parentb18740932759391b5cbdd20fe0a05e86b155e6f1 (diff)
downloadnautilus-82d2b78b236123fee80ae9c0b5170924355e12c7.tar.gz
Also support a mode where the target URI is NULL, and the target slot is
2008-07-15 Christian Neumair <cneumair@gnome.org> * libnautilus-private/nautilus-dnd.c (slot_proxy_drag_motion), (nautilus_drag_slot_proxy_init): Also support a mode where the target URI is NULL, and the target slot is set. * src/nautilus-notebook.c (build_tab_label): Set up notebook labels as slot drag proxy, replace old DND code. svn path=/trunk/; revision=14360
Diffstat (limited to 'libnautilus-private/nautilus-dnd.c')
-rw-r--r--libnautilus-private/nautilus-dnd.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c
index 744f9986a..fe7cbf84c 100644
--- a/libnautilus-private/nautilus-dnd.c
+++ b/libnautilus-private/nautilus-dnd.c
@@ -1003,10 +1003,12 @@ slot_proxy_drag_motion (GtkWidget *widget,
unsigned int time,
gpointer user_data)
{
+ NautilusDragSlotProxyInfo *drag_info;
+ NautilusWindowSlotInfo *target_slot;
+ GtkWidget *window;
GdkAtom target;
int action;
char *target_uri;
- NautilusDragSlotProxyInfo *drag_info;
drag_info = user_data;
@@ -1016,6 +1018,9 @@ slot_proxy_drag_motion (GtkWidget *widget,
goto out;
}
+ window = gtk_widget_get_toplevel (widget);
+ g_assert (NAUTILUS_IS_WINDOW_INFO (window));
+
if (!drag_info->have_data) {
target = gtk_drag_dest_find_target (widget, context, NULL);
gtk_drag_get_data (widget, context, target, time);
@@ -1024,6 +1029,16 @@ slot_proxy_drag_motion (GtkWidget *widget,
target_uri = NULL;
if (drag_info->target_location != NULL) {
target_uri = g_file_get_uri (drag_info->target_location);
+ } else {
+ if (drag_info->target_slot != NULL) {
+ target_slot = drag_info->target_slot;
+ } else {
+ target_slot = nautilus_window_info_get_active_slot (NAUTILUS_WINDOW_INFO (window));
+ }
+
+ if (target_slot != NULL) {
+ target_uri = nautilus_window_slot_info_get_current_location (target_slot);
+ }
}
if (drag_info->have_data &&
@@ -1253,8 +1268,6 @@ nautilus_drag_slot_proxy_init (GtkWidget *widget,
GDK_ACTION_LINK |
GDK_ACTION_ASK);
- gtk_drag_source_add_uri_targets (widget);
-
target_list = gtk_target_list_new (targets, G_N_ELEMENTS (targets));
gtk_target_list_add_uri_targets (target_list, NAUTILUS_ICON_DND_URI_LIST);
gtk_drag_dest_set_target_list (widget, target_list);