Definitly not a patent breaking spring loaded folders patch



Decided that, seeing as I live in a country that doesn't have dumb
software patents (hey, at least we have a few things going for us), I
didn't see why I shouldn't be able to have spring loaded folders, cos
they're really useful for moving things around.

So, hacked it up.

There's things mentioned in the Apple patent that this patch doesn't do
and therefore I don't think it violates the patent...all IP
bloodsuck^wlawyers feel free to correct me.
a) Apple says that windows close when the mouse pointer leaves them
b) Apple says that already open windows "zoom"* to the cursor instead
   of reopening.

Basically, the patch is, drag an icon over a folder icon, wait
750milliseconds and it will open in a new window, repeat ad infinitum.
Dropping the file closes all windows that were "sprung" as does
cancelling the drag with ESC.

The only thing might be to keep the last window open after the drop,
which is what the Apple patent says happens, but I dunno if
1) it would be better
2) I could be arsed doing it.

Anyway, enjoy patch

iain
-- 
Index: libnautilus/nautilus-view-component.idl
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-view-component.idl,v
retrieving revision 1.46
diff -u -p -r1.46 nautilus-view-component.idl
--- libnautilus/nautilus-view-component.idl	15 May 2002 15:57:18 -0000	1.46
+++ libnautilus/nautilus-view-component.idl	25 Feb 2003 17:48:49 -0000
@@ -90,6 +90,9 @@ module Nautilus {
 		oneway void open_location_force_new_window (in URI location,
 							    in URIList selection);
 
+		oneway void open_location_spring_loaded (in URI location,
+							 in URIList selection);
+
 		/* Called by a view component when the location
 		 * changes, but the view component is handling it
 		 * directly. This differs from
@@ -151,6 +154,8 @@ module Nautilus {
 		 */
 		oneway void go_back ();
 		oneway void close_window ();
+
+		oneway void close_sprung_windows ();
 	};
 
 };
Index: libnautilus/nautilus-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-view.c,v
retrieving revision 1.94
diff -u -p -r1.94 nautilus-view.c
--- libnautilus/nautilus-view.c	15 May 2002 15:57:19 -0000	1.94
+++ libnautilus/nautilus-view.c	25 Feb 2003 17:48:49 -0000
@@ -607,6 +607,27 @@ call_open_location_force_new_window (Nau
 }
 
 static void
+call_open_location_spring_loaded (NautilusView *view,
+				  gpointer callback_data)
+{
+	LocationPlus *location_plus;
+	CORBA_Environment ev;
+	Nautilus_ViewFrame view_frame;
+	Nautilus_URIList *uri_list;
+
+	location_plus = callback_data;
+
+	view_frame = view_frame_call_begin (view, &ev);
+	if (view_frame != CORBA_OBJECT_NIL) {
+		uri_list = nautilus_uri_list_from_g_list (location_plus->selection);
+		Nautilus_ViewFrame_open_location_spring_loaded
+			(view_frame, location_plus->location, uri_list, &ev);
+		CORBA_free (uri_list);
+	}
+	view_frame_call_end (view_frame, &ev);
+}
+
+static void
 call_report_location_change (NautilusView *view,
 			     gpointer callback_data)
 {
@@ -788,6 +809,19 @@ call_close_window (NautilusView *view,
 	view_frame_call_end (view_frame, &ev);
 }
 
+static void
+call_close_sprung_windows (NautilusView *view,
+			   gpointer callback_data)
+{
+	CORBA_Environment ev;
+	Nautilus_ViewFrame view_frame;
+
+	view_frame = view_frame_call_begin (view, &ev);
+	if (view_frame != CORBA_OBJECT_NIL) {
+		Nautilus_ViewFrame_close_sprung_windows (view_frame, &ev);
+	}
+	view_frame_call_end (view_frame, &ev);
+}
 
 void
 nautilus_view_open_location_in_this_window (NautilusView *view,
@@ -827,6 +861,23 @@ nautilus_view_open_location_force_new_wi
 }
 
 void
+nautilus_view_open_location_spring_loaded (NautilusView *view,
+					   const char *location,
+					   GList *selection)
+{
+	LocationPlus *location_plus;
+	
+	location_plus = g_new0 (LocationPlus, 1);
+	location_plus->location = g_strdup (location);
+	location_plus->selection = str_list_copy (selection);
+
+	queue_outgoing_call (view,
+			     call_open_location_spring_loaded,
+			     location_plus,
+			     free_location_plus_callback);
+}
+
+void
 nautilus_view_report_location_change (NautilusView *view,
 				      const char *location,
 				      GList *selection,
@@ -951,6 +1002,15 @@ nautilus_view_close_window (NautilusView
 			     NULL);
 }
 
+void
+nautilus_view_close_sprung_windows (NautilusView *view)
+{
+	queue_outgoing_call (view,
+			     call_close_sprung_windows,
+			     NULL,
+			     NULL);
+}
+				  
 BonoboControl *
 nautilus_view_get_bonobo_control (NautilusView *view)
 {
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.317
diff -u -p -r1.317 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	1 Feb 2003 02:32:54 -0000	1.317
+++ libnautilus-private/nautilus-icon-container.c	25 Feb 2003 17:48:49 -0000
@@ -202,6 +202,7 @@ enum {
 	SELECTION_CHANGED,
 	ICON_ADDED,
 	ICON_REMOVED,
+	ICON_DROP_TARGET_CHANGED,
 	CLEARED,
 	LAST_SIGNAL
 };
@@ -3467,6 +3468,16 @@ nautilus_icon_container_class_init (Naut
 		                g_cclosure_marshal_VOID__POINTER,
 		                G_TYPE_NONE, 1, G_TYPE_POINTER);
 
+	signals[ICON_DROP_TARGET_CHANGED]
+		= g_signal_new ("icon_drop_target_changed",
+				G_TYPE_FROM_CLASS (class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (NautilusIconContainerClass,
+						 icon_drop_target_changed),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__POINTER,
+				G_TYPE_NONE, 1, G_TYPE_POINTER);
+
 	signals[CLEARED]
 		= g_signal_new ("cleared",
 		                G_TYPE_FROM_CLASS (class),
@@ -6005,6 +6016,14 @@ nautilus_icon_container_accessible_get_t
         }
 
         return type;
+}
+
+void
+nautilus_icon_container_drop_target_changed (NautilusIconContainer *container,
+				   	     NautilusIcon *icon)
+{
+	g_signal_emit (G_OBJECT (container), signals[ICON_DROP_TARGET_CHANGED],
+		       0, icon ? icon->data : NULL);
 }
 
 #if ! defined (NAUTILUS_OMIT_SELF_CHECK)
Index: libnautilus-private/nautilus-icon-container.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.h,v
retrieving revision 1.74
diff -u -p -r1.74 nautilus-icon-container.h
--- libnautilus-private/nautilus-icon-container.h	16 Oct 2002 16:27:20 -0000	1.74
+++ libnautilus-private/nautilus-icon-container.h	25 Feb 2003 17:48:49 -0000
@@ -161,6 +161,8 @@ typedef struct {
                                                    NautilusIconData *data);
         void         (* icon_removed)             (NautilusIconContainer *container,
                                                    NautilusIconData *data);
+	void	     (* icon_drop_target_changed) (NautilusIconContainer *container,
+						   NautilusIconData *data);
         void         (* cleared)                  (NautilusIconContainer *container);
 } NautilusIconContainerClass;
 
Index: libnautilus-private/nautilus-icon-dnd.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-dnd.c,v
retrieving revision 1.126
diff -u -p -r1.126 nautilus-icon-dnd.c
--- libnautilus-private/nautilus-icon-dnd.c	17 Feb 2003 09:20:55 -0000	1.126
+++ libnautilus-private/nautilus-icon-dnd.c	25 Feb 2003 17:48:50 -0000
@@ -1108,6 +1108,8 @@ set_drop_target (NautilusIconContainer *
 	container->details->drop_target = icon;
 	nautilus_icon_container_update_icon (container, old_icon);
 	nautilus_icon_container_update_icon (container, icon);
+
+	nautilus_icon_container_drop_target_changed (container, icon);
 }
 
 static void
@@ -1238,7 +1240,7 @@ nautilus_icon_dnd_begin_drag (NautilusIc
 				  actions,
 				  button,
 				  (GdkEvent *) event);
-
+	
 	if (context) {
 		/* set the icon for dragging */
 		gtk_drag_set_icon_pixbuf (context, pixbuf, x_offset, y_offset);
@@ -1296,7 +1298,7 @@ void
 nautilus_icon_dnd_end_drag (NautilusIconContainer *container)
 {
 	NautilusIconDndInfo *dnd_info;
-
+	
 	g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
 		
 	dnd_info = container->details->dnd_info;
Index: src/nautilus-view-frame-corba.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-view-frame-corba.c,v
retrieving revision 1.42
diff -u -p -r1.42 nautilus-view-frame-corba.c
--- src/nautilus-view-frame-corba.c	17 Jan 2002 01:39:26 -0000	1.42
+++ src/nautilus-view-frame-corba.c	25 Feb 2003 17:48:50 -0000
@@ -102,6 +102,19 @@ open_force_new_window (NautilusViewFrame
 }
 
 static void
+open_spring_loaded_window (NautilusViewFrame *view,
+			   gpointer callback_data)
+{
+	LocationPlus *location_plus;
+
+	location_plus = callback_data;
+	nautilus_view_frame_open_location_spring_loaded
+		(view,
+		 location_plus->location,
+		 location_plus->selection);
+}
+
+static void
 report_location_change (NautilusViewFrame *view,
 			gpointer callback_data)
 {
@@ -194,6 +207,13 @@ close_window (NautilusViewFrame *view,
 }
 
 static void
+close_sprung_windows (NautilusViewFrame *view,
+		      gpointer callback_data)
+{
+	nautilus_view_frame_close_sprung_windows (view);
+}
+
+static void
 impl_Nautilus_ViewFrame_open_location_in_this_window (PortableServer_Servant servant,
 						      const CORBA_char *location,
 						      CORBA_Environment *ev)
@@ -237,6 +257,25 @@ impl_Nautilus_ViewFrame_open_location_fo
 }
 
 static void
+impl_Nautilus_ViewFrame_open_location_spring_loaded (PortableServer_Servant servant,
+						     const CORBA_char *location,
+						     const Nautilus_URIList *selection,
+						     CORBA_Environment *ev)
+{
+	LocationPlus *location_plus;
+
+	location_plus = g_new0 (LocationPlus, 1);
+	location_plus->location = g_strdup (location);
+	location_plus->selection = nautilus_g_list_from_uri_list (selection);
+
+	nautilus_view_frame_queue_incoming_call
+		(servant,
+		 open_spring_loaded_window,
+		 location_plus,
+		 free_location_plus_callback);
+}
+
+static void
 impl_Nautilus_ViewFrame_report_location_change (PortableServer_Servant servant,
 						const CORBA_char *location,
 						const Nautilus_URIList *selection,
@@ -381,6 +420,14 @@ impl_Nautilus_ViewFrame_close_window (Po
 		(servant, close_window, NULL, NULL);
 }
 
+static void
+impl_Nautilus_ViewFrame_close_sprung_windows (PortableServer_Servant servant,
+					      CORBA_Environment *ev)
+{
+	nautilus_view_frame_queue_incoming_call
+		(servant, close_sprung_windows, NULL, NULL);
+}
+
 static GType nautilus_view_frame_corba_part_get_type (void);
 
 BONOBO_CLASS_BOILERPLATE_FULL (NautilusViewFrameCorbaPart, nautilus_view_frame_corba_part,
@@ -396,6 +443,7 @@ nautilus_view_frame_corba_part_class_ini
 	class->epv.open_location_in_this_window = impl_Nautilus_ViewFrame_open_location_in_this_window;
 	class->epv.open_location_prefer_existing_window = impl_Nautilus_ViewFrame_open_location_prefer_existing_window;
 	class->epv.open_location_force_new_window = impl_Nautilus_ViewFrame_open_location_force_new_window;
+	class->epv.open_location_spring_loaded = impl_Nautilus_ViewFrame_open_location_spring_loaded;
 	class->epv.report_location_change = impl_Nautilus_ViewFrame_report_location_change;
 	class->epv.report_redirect = impl_Nautilus_ViewFrame_report_redirect;
 	class->epv.report_selection_change = impl_Nautilus_ViewFrame_report_selection_change;
@@ -407,6 +455,7 @@ nautilus_view_frame_corba_part_class_ini
 	class->epv.set_title = impl_Nautilus_ViewFrame_set_title;
 	class->epv.go_back = impl_Nautilus_ViewFrame_go_back;
 	class->epv.close_window = impl_Nautilus_ViewFrame_close_window;
+	class->epv.close_sprung_windows = impl_Nautilus_ViewFrame_close_sprung_windows;
 }
 
 static void
Index: src/nautilus-view-frame.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-view-frame.c,v
retrieving revision 1.160
diff -u -p -r1.160 nautilus-view-frame.c
--- src/nautilus-view-frame.c	14 Jan 2003 16:52:47 -0000	1.160
+++ src/nautilus-view-frame.c	25 Feb 2003 17:48:50 -0000
@@ -60,10 +60,12 @@ enum {
 	GET_HISTORY_LIST,
 	GO_BACK,
 	CLOSE_WINDOW,
+	CLOSE_SPRUNG_WINDOWS,
 	LOAD_COMPLETE,
 	LOAD_PROGRESS_CHANGED,
 	LOAD_UNDERWAY,
 	OPEN_LOCATION_FORCE_NEW_WINDOW,
+	OPEN_LOCATION_SPRING_LOADED,
 	OPEN_LOCATION_IN_THIS_WINDOW,
 	OPEN_LOCATION_PREFER_EXISTING_WINDOW,
 	REPORT_LOCATION_CHANGE,
@@ -1108,6 +1110,23 @@ nautilus_view_frame_open_location_force_
 }
 
 void
+nautilus_view_frame_open_location_spring_loaded (NautilusViewFrame *view,
+						 const char *location,
+						 GList *selection)
+{
+	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
+
+	if (view->details->state == VIEW_FRAME_FAILED) {
+		return;
+	}
+
+	view_frame_wait_is_over (view);
+	g_signal_emit (view,
+		       signals[OPEN_LOCATION_SPRING_LOADED], 0,
+		       location, selection);
+}
+
+void
 nautilus_view_frame_report_location_change (NautilusViewFrame *view,
 					    const char *location,
 					    GList *selection,
@@ -1246,6 +1265,14 @@ nautilus_view_frame_close_window (Nautil
 }
 
 void
+nautilus_view_frame_close_sprung_windows (NautilusViewFrame *view)
+{
+	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
+
+	g_signal_emit (view, signals[CLOSE_SPRUNG_WINDOWS], 0);
+}
+
+void
 nautilus_view_frame_set_title (NautilusViewFrame *view,
                                const char *title)
 {
@@ -1441,6 +1468,15 @@ nautilus_view_frame_class_init (Nautilus
 		 NULL, NULL,
 		 g_cclosure_marshal_VOID__VOID,
 		 G_TYPE_NONE, 0);
+	signals[CLOSE_SPRUNG_WINDOWS] = g_signal_new
+		("close_sprung_windows",
+		 G_TYPE_FROM_CLASS (class),
+		 G_SIGNAL_RUN_LAST,
+		 G_STRUCT_OFFSET (NautilusViewFrameClass,
+				  close_sprung_windows),
+		 NULL, NULL,
+		 g_cclosure_marshal_VOID__VOID,
+		 G_TYPE_NONE, 0);
 	signals[LOAD_COMPLETE] = g_signal_new
 		("load_complete",
 		 G_TYPE_FROM_CLASS (class),
@@ -1474,6 +1510,15 @@ nautilus_view_frame_class_init (Nautilus
 		 G_SIGNAL_RUN_LAST,
 		 G_STRUCT_OFFSET (NautilusViewFrameClass, 
 				  open_location_force_new_window),
+		 NULL, NULL,
+		 eel_marshal_VOID__STRING_POINTER,
+		 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER);
+	signals[OPEN_LOCATION_SPRING_LOADED] = g_signal_new
+		("open_location_spring_loaded",
+		 G_TYPE_FROM_CLASS (class),
+		 G_SIGNAL_RUN_LAST,
+		 G_STRUCT_OFFSET (NautilusViewFrameClass,
+				  open_location_spring_loaded),
 		 NULL, NULL,
 		 eel_marshal_VOID__STRING_POINTER,
 		 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER);
Index: src/nautilus-view-frame.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-view-frame.h,v
retrieving revision 1.70
diff -u -p -r1.70 nautilus-view-frame.h
--- src/nautilus-view-frame.h	4 Feb 2003 10:36:14 -0000	1.70
+++ src/nautilus-view-frame.h	25 Feb 2003 17:48:50 -0000
@@ -72,6 +72,9 @@ typedef struct {
         void               (* open_location_force_new_window)       (NautilusViewFrame *view,
                                                                      const char        *location,
                                                                      GList             *selection); /* list of char * */
+        void               (* open_location_spring_loaded)          (NautilusViewFrame *view,
+                                                                     const char        *location,
+                                                                     GList             *selection); /* list of char * */
         void               (* report_location_change)               (NautilusViewFrame *view,
                                                                      const char        *location,
                                                                      GList             *selection, /* list of char * */
@@ -93,6 +96,7 @@ typedef struct {
 	Nautilus_History * (* get_history_list)                     (NautilusViewFrame *view);
         void               (* go_back)                              (NautilusViewFrame *view);
         void               (* close_window)                         (NautilusViewFrame *view);
+        void               (* close_sprung_windows)                 (NautilusViewFrame *view);
 } NautilusViewFrameClass;
 
 /* basic view management */
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.313
diff -u -p -r1.313 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	12 Dec 2002 09:05:22 -0000	1.313
+++ src/nautilus-window-manage-views.c	25 Feb 2003 17:48:51 -0000
@@ -113,6 +113,8 @@ static void free_location_change   (Naut
 static void end_location_change    (NautilusWindow             *window);
 static void cancel_location_change (NautilusWindow             *window);
 
+static GList *spring_loaded_folders = NULL;
+
 static void
 change_selection (NautilusWindow *window,
                   GList *selection,
@@ -712,7 +714,8 @@ static void
 open_location (NautilusWindow *window,
                const char *location,
                gboolean force_new_window,
-               GList *new_selection)
+               GList *new_selection,
+               gboolean spring_loaded)
 {
         NautilusWindow *target_window;
         gboolean create_new_window;
@@ -743,6 +746,9 @@ open_location (NautilusWindow *window,
                 target_window = nautilus_application_create_window (
 						window->application,
 						gtk_window_get_screen (GTK_WINDOW (window)));
+                if (spring_loaded) {
+                        spring_loaded_folders = g_list_append (spring_loaded_folders, target_window);
+                }
 	}
 
 	eel_g_list_free_deep (target_window->details->pending_selection);
@@ -760,7 +766,7 @@ void
 nautilus_window_open_location (NautilusWindow *window,
                                const char *location)
 {
-        open_location (window, location, FALSE, NULL);
+        open_location (window, location, FALSE, NULL, FALSE);
 }
 
 void
@@ -768,7 +774,7 @@ nautilus_window_open_location_with_selec
 					      const char *location,
 					      GList *selection)
 {
-	open_location (window, location, FALSE, selection);
+	open_location (window, location, FALSE, selection, FALSE);
 }					      
 
 
@@ -1815,6 +1821,23 @@ close_window_callback (NautilusViewFrame
 }
 
 static void
+close_sprung_windows_callback (NautilusViewFrame *view,
+                               NautilusWindow *window)
+{
+        GList *slf, *s;
+        g_assert (NAUTILUS_IS_WINDOW (window));
+
+        slf = spring_loaded_folders;
+        spring_loaded_folders = NULL;
+
+        for (s = slf; s; s = s->next) {
+                nautilus_window_close (NAUTILUS_WINDOW (s->data));
+        }
+
+        g_list_free (slf);
+}
+
+static void
 change_selection_callback (NautilusViewFrame *view,
                            GList *selection,
                            NautilusWindow *window)
@@ -1915,7 +1938,7 @@ open_location_prefer_existing_window_cal
         }
 
         /* Otherwise, open a new window. */
-        open_location (window, location, TRUE, NULL);
+        open_location (window, location, TRUE, NULL, FALSE);
 }
 
 static void
@@ -1926,7 +1949,18 @@ open_location_force_new_window_callback 
 {
         g_assert (NAUTILUS_IS_WINDOW (window));
 
-        open_location (window, location, TRUE, selection);
+        open_location (window, location, TRUE, selection, FALSE);
+}
+
+static void
+open_location_spring_loaded_callback (NautilusViewFrame *view,
+                                      const char *location,
+                                      GList *selection,
+                                      NautilusWindow *window)
+{
+        g_assert (NAUTILUS_IS_WINDOW (window));
+
+        open_location (window, location, TRUE, selection, TRUE);
 }
 
 static void
@@ -2127,10 +2161,12 @@ view_loaded_callback (NautilusViewFrame 
 	macro (get_history_list)			\
 	macro (go_back)					\
         macro (close_window)                            \
-	macro (load_complete)				\
+        macro (close_sprung_windows)                    \
+        macro (load_complete)				\
 	macro (load_underway)				\
 	macro (open_location_force_new_window)		\
-	macro (open_location_in_this_window)		\
+        macro (open_location_spring_loaded)             \
+        macro (open_location_in_this_window)		\
 	macro (open_location_prefer_existing_window)	\
 	macro (report_location_change)			\
 	macro (report_redirect)				\
Index: src/file-manager/fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.272
diff -u -p -r1.272 fm-icon-view.c
--- src/file-manager/fm-icon-view.c	8 Feb 2003 22:19:26 -0000	1.272
+++ src/file-manager/fm-icon-view.c	25 Feb 2003 17:48:52 -0000
@@ -136,6 +136,9 @@ struct FMIconViewDetails
 
 	gboolean filter_by_screen;
 	int num_screens;
+
+	guint spring_id;
+	NautilusFile *spring_drop_target;
 };
 
 
@@ -1850,6 +1853,51 @@ selection_changed_callback (NautilusIcon
 	fm_directory_view_notify_selection_changed (FM_DIRECTORY_VIEW (icon_view));
 }
 
+static gboolean
+spring_folder (gpointer data)
+{
+	NautilusView *view;
+	FMIconView *icon_view = data;
+	char *location_uri;
+
+	view = fm_directory_view_get_nautilus_view (FM_DIRECTORY_VIEW (icon_view));
+
+	location_uri = nautilus_file_get_uri (icon_view->details->spring_drop_target);
+	nautilus_view_open_location_spring_loaded (view, location_uri, NULL);
+	g_free (location_uri);
+	
+	icon_view->details->spring_id = 0;
+	return FALSE;
+}
+		
+static void
+drop_target_changed_callback (NautilusIconContainer *container,
+			      NautilusIconData *data,
+			      FMIconView *icon_view)
+{
+	if (icon_view->details->spring_id > 0) {
+		g_source_remove (icon_view->details->spring_id);
+	}
+
+	if (data == NULL) {
+		return;
+	}
+	
+	icon_view->details->spring_drop_target = NAUTILUS_FILE (data);
+	icon_view->details->spring_id = g_timeout_add (500, spring_folder, icon_view);
+}
+
+static void
+drag_end_callback (NautilusIconContainer *container,
+		   GdkDragContext *context,
+		   FMIconView *icon_view)
+{
+	NautilusView *view;
+
+	view = fm_directory_view_get_nautilus_view (FM_DIRECTORY_VIEW (icon_view));
+	nautilus_view_close_sprung_windows (view);
+}
+
 static void
 icon_container_context_click_selection_callback (NautilusIconContainer *container,
 						 GdkEventButton *event,
@@ -2238,6 +2286,10 @@ create_icon_container (FMIconView *icon_
 				 G_CALLBACK (fm_icon_view_icon_text_changed_callback), icon_view, 0);
 	g_signal_connect_object (icon_container, "selection_changed",
 				 G_CALLBACK (selection_changed_callback), icon_view, 0);
+	g_signal_connect (icon_container, "icon_drop_target_changed",
+			  G_CALLBACK (drop_target_changed_callback), icon_view);
+	g_signal_connect (icon_container, "drag_end",
+			  G_CALLBACK (drag_end_callback), icon_view);
 	/* FIXME: many of these should move into fm-icon-container as virtual methods */
 	g_signal_connect_object (icon_container, "get_icon_uri",
 				 G_CALLBACK (get_icon_uri_callback), icon_view, 0);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]