Spring Loaded Folders Reloaded



Dave liked the first patch, but managed to break it
So this fixes the breakages.
He also wanted no warnings so I turned on -Werror
Except then I had to do loads of gtk_idle gtk_timeout changes as well
And now I'm too tired to remove them from the patch.

Must sleep now.
iain
-- 
Index: components/throbber/nautilus-throbber.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/throbber/nautilus-throbber.c,v
retrieving revision 1.33
diff -u -p -r1.33 nautilus-throbber.c
--- components/throbber/nautilus-throbber.c	4 Nov 2002 14:59:52 -0000	1.33
+++ components/throbber/nautilus-throbber.c	26 Feb 2003 01:13:20 -0000
@@ -284,7 +284,8 @@ nautilus_throbber_expose (GtkWidget *wid
 	GdkPixbuf *pixbuf;
 	int x_offset, y_offset, width, height;
 	GdkRectangle pix_area, dest;
-
+	GdkGC *gc;
+	
 	g_return_val_if_fail (NAUTILUS_IS_THROBBER (widget), FALSE);
 
 	throbber = NAUTILUS_THROBBER (widget);
@@ -313,15 +314,14 @@ nautilus_throbber_expose (GtkWidget *wid
 		g_object_unref (pixbuf);
 		return FALSE;
 	}
-	
-	gdk_pixbuf_render_to_drawable_alpha (
-		pixbuf, widget->window, 
-		dest.x - x_offset, dest.y - y_offset,
-		dest.x, dest.y,
-		dest.width, dest.height,
-		GDK_PIXBUF_ALPHA_BILEVEL, 128,
-		GDK_RGB_DITHER_MAX,
-		0, 0);
+
+	gc = gdk_gc_new (widget->window);
+	gdk_draw_pixbuf (widget->window, gc, pixbuf,
+			 dest.x - x_offset, dest.y - y_offset,
+			 dest.x, dest.y,
+			 dest.width, dest.height,
+			 GDK_RGB_DITHER_MAX, 0, 0);
+	g_object_unref (G_OBJECT (gc));
 
 	g_object_unref (pixbuf);
 
@@ -371,21 +371,21 @@ nautilus_throbber_start (NautilusThrobbe
 	}
 
 	if (throbber->details->timer_task != 0) {
-		gtk_timeout_remove (throbber->details->timer_task);
+		g_source_remove (throbber->details->timer_task);
 	}
 	
 	/* reset the frame count */
 	throbber->details->current_frame = 0;
-	throbber->details->timer_task = gtk_timeout_add (throbber->details->delay,
-							 bump_throbber_frame,
-							 throbber);
+	throbber->details->timer_task = g_timeout_add (throbber->details->delay,
+						       bump_throbber_frame,
+						       throbber);
 }
 
 static void
 nautilus_throbber_remove_update_callback (NautilusThrobber *throbber)
 {
 	if (throbber->details->timer_task != 0) {
-		gtk_timeout_remove (throbber->details->timer_task);
+		g_source_remove (throbber->details->timer_task);
 	}
 	
 	throbber->details->timer_task = 0;
Index: libnautilus/nautilus-idle-queue.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-idle-queue.c,v
retrieving revision 1.5
diff -u -p -r1.5 nautilus-idle-queue.c
--- libnautilus/nautilus-idle-queue.c	15 Sep 2001 19:17:41 -0000	1.5
+++ libnautilus/nautilus-idle-queue.c	26 Feb 2003 01:13:20 -0000
@@ -109,7 +109,7 @@ nautilus_idle_queue_add (NautilusIdleQue
 	queue->functions = g_list_prepend (queue->functions, function);
 
 	if (queue->idle_id == 0) {
-		queue->idle_id = gtk_idle_add (execute_queued_functions, queue);
+		queue->idle_id = g_idle_add (execute_queued_functions, queue);
 	}
 }
 
@@ -137,7 +137,7 @@ nautilus_idle_queue_destroy (NautilusIdl
 	g_list_free (queue->functions);
 
 	if (queue->idle_id != 0) {
-		gtk_idle_remove (queue->idle_id);
+		g_source_remove (queue->idle_id);
 	}
 
 	g_free (queue);
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	26 Feb 2003 01:13:20 -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	26 Feb 2003 01:13:20 -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/nautilus-view.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-view.h,v
retrieving revision 1.48
diff -u -p -r1.48 nautilus-view.h
--- libnautilus/nautilus-view.h	4 Feb 2003 10:36:00 -0000	1.48
+++ libnautilus/nautilus-view.h	26 Feb 2003 01:13:20 -0000
@@ -77,6 +77,9 @@ void               nautilus_view_open_lo
 void               nautilus_view_open_location_force_new_window       (NautilusView           *view,
 								       const char             *location_uri,
 								       GList                  *selection); /* list of URI char *s */
+void               nautilus_view_open_location_spring_loaded          (NautilusView           *view,
+								       const char             *location_uri,
+								       GList                  *selection); /* list of URI char *s */
 void               nautilus_view_report_location_change               (NautilusView           *view,
 								       const char             *location_uri,
 								       GList                  *selection, /* list of URI char *s */
@@ -99,6 +102,7 @@ void               nautilus_view_set_tit
 								       const char             *title);
 void               nautilus_view_go_back                              (NautilusView           *view);
 void               nautilus_view_close_window                         (NautilusView           *view);
+void               nautilus_view_close_sprung_windows                 (NautilusView           *view);
 
 /* Some utility functions useful for doing the CORBA work directly.
  * Not needed by most components, but shared with the view frame code,
Index: libnautilus-private/nautilus-bonobo-extensions.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-bonobo-extensions.c,v
retrieving revision 1.46
diff -u -p -r1.46 nautilus-bonobo-extensions.c
--- libnautilus-private/nautilus-bonobo-extensions.c	11 Feb 2003 09:12:40 -0000	1.46
+++ libnautilus-private/nautilus-bonobo-extensions.c	26 Feb 2003 01:13:21 -0000
@@ -547,8 +547,8 @@ bonobo_activation_activation_callback (B
 	if (handle->cancel) {
 		activation_cancel (handle);
 	} else {
-		handle->idle_id = gtk_idle_add (activation_idle_callback,
-						handle);
+		handle->idle_id = g_idle_add (activation_idle_callback,
+					      handle);
 	}
 }
 
@@ -610,7 +610,7 @@ nautilus_bonobo_activate_cancel (Nautilu
 		/* no way to cancel the underlying bonobo-activation call, so we just set a flag */
 		handle->cancel = TRUE;
 	} else {
-		gtk_idle_remove (handle->idle_id);
+		g_source_remove (handle->idle_id);
 		activation_cancel (handle);
 	}
 }
Index: libnautilus-private/nautilus-directory-async.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-directory-async.c,v
retrieving revision 1.196
diff -u -p -r1.196 nautilus-directory-async.c
--- libnautilus-private/nautilus-directory-async.c	29 Jan 2003 10:21:40 -0000	1.196
+++ libnautilus-private/nautilus-directory-async.c	26 Feb 2003 01:13:21 -0000
@@ -970,7 +970,7 @@ nautilus_directory_schedule_dequeue_pend
 {
 	if (directory->details->dequeue_pending_idle_id == 0) {
 		directory->details->dequeue_pending_idle_id
-			= gtk_idle_add (dequeue_pending_idle_callback, directory);
+			= g_idle_add (dequeue_pending_idle_callback, directory);
 	}
 }
 
@@ -1005,7 +1005,7 @@ file_list_cancel (NautilusDirectory *dir
 	directory_load_cancel (directory);
 	
 	if (directory->details->dequeue_pending_idle_id != 0) {
-		gtk_idle_remove (directory->details->dequeue_pending_idle_id);
+		g_source_remove (directory->details->dequeue_pending_idle_id);
 		directory->details->dequeue_pending_idle_id = 0;
 	}
 
@@ -1049,7 +1049,7 @@ directory_load_done (NautilusDirectory *
 
 	/* Call the idle function right away. */
 	if (directory->details->dequeue_pending_idle_id != 0) {
-		gtk_idle_remove (directory->details->dequeue_pending_idle_id);
+		g_source_remove (directory->details->dequeue_pending_idle_id);
 	}
 	dequeue_pending_idle_callback (directory);
 }
Index: libnautilus-private/nautilus-directory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-directory.c,v
retrieving revision 1.243
diff -u -p -r1.243 nautilus-directory.c
--- libnautilus-private/nautilus-directory.c	10 Feb 2003 19:38:39 -0000	1.243
+++ libnautilus-private/nautilus-directory.c	26 Feb 2003 01:13:22 -0000
@@ -188,7 +188,7 @@ nautilus_directory_finalize (GObject *ob
 	bonobo_object_release_unref (directory->details->metafile_corba_object, NULL);
 
 	if (directory->details->dequeue_pending_idle_id != 0) {
-		gtk_idle_remove (directory->details->dequeue_pending_idle_id);
+		g_source_remove (directory->details->dequeue_pending_idle_id);
 	}
  
 	g_free (directory->details->uri);
Index: libnautilus-private/nautilus-dnd.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-dnd.c,v
retrieving revision 1.13
diff -u -p -r1.13 nautilus-dnd.c
--- libnautilus-private/nautilus-dnd.c	8 Feb 2003 22:19:24 -0000	1.13
+++ libnautilus-private/nautilus-dnd.c	26 Feb 2003 01:13:22 -0000
@@ -764,14 +764,14 @@ nautilus_drag_autoscroll_start (Nautilus
 			drag_info->start_auto_scroll_in = eel_get_system_time() 
 				+ AUTOSCROLL_INITIAL_DELAY;
 			
-			drag_info->auto_scroll_timeout_id = gtk_timeout_add
+			drag_info->auto_scroll_timeout_id = g_timeout_add
 				(AUTOSCROLL_TIMEOUT_INTERVAL,
 				 callback,
 			 	 user_data);
 		}
 	} else {
 		if (drag_info->auto_scroll_timeout_id != 0) {
-			gtk_timeout_remove (drag_info->auto_scroll_timeout_id);
+			g_source_remove (drag_info->auto_scroll_timeout_id);
 			drag_info->auto_scroll_timeout_id = 0;
 		}
 	}
@@ -781,7 +781,7 @@ void
 nautilus_drag_autoscroll_stop (NautilusDragInfo *drag_info)
 {
 	if (drag_info->auto_scroll_timeout_id != 0) {
-		gtk_timeout_remove (drag_info->auto_scroll_timeout_id);
+		g_source_remove (drag_info->auto_scroll_timeout_id);
 		drag_info->auto_scroll_timeout_id = 0;
 	}
 }
Index: libnautilus-private/nautilus-drag-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-drag-window.c,v
retrieving revision 1.14
diff -u -p -r1.14 nautilus-drag-window.c
--- libnautilus-private/nautilus-drag-window.c	20 Apr 2002 21:11:26 -0000	1.14
+++ libnautilus-private/nautilus-drag-window.c	26 Feb 2003 01:13:22 -0000
@@ -145,7 +145,7 @@ remove_focus_timeout (GtkWindow *window)
 	details = get_details (window);
 
 	if (details != NULL && details->focus_timeout_tag != 0) {
-		gtk_timeout_remove (details->focus_timeout_tag);
+		g_source_remove (details->focus_timeout_tag);
 		details->focus_timeout_tag = 0;
 	}
 }
@@ -160,8 +160,8 @@ set_focus_timeout (GtkWindow *window)
 	if (details != NULL) {
 		remove_focus_timeout (window);
 		details->focus_timeout_tag
-		    = gtk_timeout_add (WINDOW_FOCUS_TIMEOUT,
-				       focus_timeout_callback, window);
+		    = g_timeout_add (WINDOW_FOCUS_TIMEOUT,
+                                     focus_timeout_callback, window);
 	}
 }
 
Index: libnautilus-private/nautilus-entry.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-entry.c,v
retrieving revision 1.50
diff -u -p -r1.50 nautilus-entry.c
--- libnautilus-private/nautilus-entry.c	24 Mar 2002 16:49:49 -0000	1.50
+++ libnautilus-private/nautilus-entry.c	26 Feb 2003 01:13:22 -0000
@@ -95,7 +95,7 @@ nautilus_entry_finalize (GObject *object
 	entry = NAUTILUS_ENTRY (object);
 
 	if (entry->details->select_idle_id != 0) {
-		gtk_idle_remove (entry->details->select_idle_id);
+		g_source_remove (entry->details->select_idle_id);
 	}
 	
 	g_free (entry->details);
@@ -236,7 +236,7 @@ nautilus_entry_select_all_at_idle (Nauti
 	 */
 
 	if (entry->details->select_idle_id == 0) {
-		entry->details->select_idle_id = gtk_idle_add (select_all_at_idle, entry);
+		entry->details->select_idle_id = g_idle_add (select_all_at_idle, entry);
 	}
 }
 
Index: libnautilus-private/nautilus-file-operations-progress.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations-progress.c,v
retrieving revision 1.38
diff -u -p -r1.38 nautilus-file-operations-progress.c
--- libnautilus-private/nautilus-file-operations-progress.c	13 Dec 2002 11:48:42 -0000	1.38
+++ libnautilus-private/nautilus-file-operations-progress.c	26 Feb 2003 01:13:22 -0000
@@ -532,7 +532,7 @@ nautilus_file_operations_progress_done (
 	/* No cancel button once the operation is done. */
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (progress), GTK_RESPONSE_CANCEL, FALSE);
 
-	progress->details->delayed_close_timeout_id = gtk_timeout_add
+	progress->details->delayed_close_timeout_id = g_timeout_add
 		(MINIMUM_TIME_UP - time_up,
 		 delayed_close_callback,
 		 progress);
Index: libnautilus-private/nautilus-icon-canvas-item.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-canvas-item.c,v
retrieving revision 1.162
diff -u -p -r1.162 nautilus-icon-canvas-item.c
--- libnautilus-private/nautilus-icon-canvas-item.c	12 Dec 2002 15:17:42 -0000	1.162
+++ libnautilus-private/nautilus-icon-canvas-item.c	26 Feb 2003 01:13:23 -0000
@@ -1103,14 +1103,17 @@ emblem_layout_next (EmblemLayout *layout
 static void
 draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y)
 {
+	GdkGC *gc;
+
+	gc = gdk_gc_new (drawable);
 	/* FIXME bugzilla.gnome.org 40703: 
 	 * Dither would be better if we passed dither values. 
 	 */
-	gdk_pixbuf_render_to_drawable_alpha (pixbuf, drawable, 0, 0, x, y,
-					     gdk_pixbuf_get_width (pixbuf),
-					     gdk_pixbuf_get_height (pixbuf),
-					     GDK_PIXBUF_ALPHA_BILEVEL, 128, GDK_RGB_DITHER_NORMAL,
-					     0, 0);
+	gdk_draw_pixbuf (drawable, gc, pixbuf, 0, 0, x, y,
+			 gdk_pixbuf_get_width (pixbuf),
+			 gdk_pixbuf_get_height (pixbuf),
+			 GDK_RGB_DITHER_NORMAL, 0, 0);
+	g_object_unref (G_OBJECT (gc));
 }
 
 /* shared code to highlight or dim the passed-in pixbuf */
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	26 Feb 2003 01:13:24 -0000
@@ -202,6 +202,7 @@ enum {
 	SELECTION_CHANGED,
 	ICON_ADDED,
 	ICON_REMOVED,
+	ICON_DROP_TARGET_CHANGED,
 	CLEARED,
 	LAST_SIGNAL
 };
@@ -611,7 +612,7 @@ unschedule_keyboard_icon_reveal (Nautilu
 	details = container->details;
 
 	if (details->keyboard_icon_reveal_timer_id != 0) {
-		gtk_timeout_remove (details->keyboard_icon_reveal_timer_id);
+		g_source_remove (details->keyboard_icon_reveal_timer_id);
 	}
 }
 
@@ -627,9 +628,9 @@ schedule_keyboard_icon_reveal (NautilusI
 
 	details->keyboard_icon_to_reveal = icon;
 	details->keyboard_icon_reveal_timer_id
-		= gtk_timeout_add (KEYBOARD_ICON_REVEAL_TIMEOUT,
-				   keyboard_icon_reveal_timeout_callback,
-				   container);
+		= g_timeout_add (KEYBOARD_ICON_REVEAL_TIMEOUT,
+				 keyboard_icon_reveal_timeout_callback,
+				 container);
 }
 
 static void
@@ -1309,7 +1310,7 @@ static void
 unschedule_redo_layout (NautilusIconContainer *container)
 {
         if (container->details->idle_id != 0) {
-		gtk_idle_remove (container->details->idle_id);
+		g_source_remove (container->details->idle_id);
 		container->details->idle_id = 0;
 	}
 }
@@ -1319,7 +1320,7 @@ schedule_redo_layout (NautilusIconContai
 {
 	if (container->details->idle_id == 0
 	    && container->details->has_been_allocated) {
-		container->details->idle_id = gtk_idle_add
+		container->details->idle_id = g_idle_add
 			(redo_layout_callback, container);
 	}
 }
@@ -1716,7 +1717,7 @@ start_rubberbanding (NautilusIconContain
 	band_info->active = TRUE;
 
 	if (band_info->timer_id == 0) {
-		band_info->timer_id = gtk_timeout_add
+		band_info->timer_id = g_timeout_add
 			(RUBBERBAND_TIMEOUT_INTERVAL,
 			 rubberband_timeout_callback,
 			 container);
@@ -1737,7 +1738,7 @@ stop_rubberbanding (NautilusIconContaine
 	band_info = &container->details->rubberband_info;
 
 	g_assert (band_info->timer_id != 0);
-	gtk_timeout_remove (band_info->timer_id);
+	g_source_remove (band_info->timer_id);
 	band_info->timer_id = 0;
 
 	band_info->active = FALSE;
@@ -2395,17 +2396,17 @@ destroy (GtkObject *object)
         nautilus_icon_container_clear (container);
 
 	if (container->details->rubberband_info.timer_id != 0) {
-		gtk_timeout_remove (container->details->rubberband_info.timer_id);
+		g_source_remove (container->details->rubberband_info.timer_id);
 		container->details->rubberband_info.timer_id = 0;
 	}
 
         if (container->details->idle_id != 0) {
-		gtk_idle_remove (container->details->idle_id);
+		g_source_remove (container->details->idle_id);
 		container->details->idle_id = 0;
 	}
 
 	if (container->details->stretch_idle_id != 0) {
-		gtk_idle_remove (container->details->stretch_idle_id);
+		g_source_remove (container->details->stretch_idle_id);
 		container->details->stretch_idle_id = 0;
 	}
        
@@ -2697,7 +2698,7 @@ static void
 remove_context_menu_timeout (NautilusIconContainer *container)
 {
 	if (container->details->context_menu_timeout_id != 0) {
-		gtk_timeout_remove (container->details->context_menu_timeout_id);
+		g_source_remove (container->details->context_menu_timeout_id);
 		container->details->context_menu_timeout_id = 0;
 	}
 }
@@ -2804,7 +2805,7 @@ continue_stretching (NautilusIconContain
 	container->details->world_y = world_y;
 
 	if (container->details->stretch_idle_id == 0) {		
-		container->details->stretch_idle_id = gtk_idle_add ((GtkFunction) update_stretch_at_idle, container);
+		container->details->stretch_idle_id = g_idle_add ((GtkFunction) update_stretch_at_idle, container);
 	}
 }
 
@@ -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,
+				   	     NautilusIconData *icon_data)
+{
+	g_signal_emit (G_OBJECT (container), signals[ICON_DROP_TARGET_CHANGED],
+		       0, icon_data);
 }
 
 #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	26 Feb 2003 01:13:24 -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;
 
@@ -241,4 +243,6 @@ void              nautilus_icon_containe
 void              nautilus_icon_container_set_use_drop_shadows          (NautilusIconContainer  *container,
 									 gboolean                use_drop_shadows);
 
+void              nautilus_icon_container_drop_target_changed           (NautilusIconContainer  *container,
+									 NautilusIconData       *icon_data);
 #endif /* NAUTILUS_ICON_CONTAINER_H */
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	26 Feb 2003 01:13:25 -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 ? icon->data : NULL);
 }
 
 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: libnautilus-private/nautilus-metafile.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-metafile.c,v
retrieving revision 1.36
diff -u -p -r1.36 nautilus-metafile.c
--- libnautilus-private/nautilus-metafile.c	9 May 2002 19:49:32 -0000	1.36
+++ libnautilus-private/nautilus-metafile.c	26 Feb 2003 01:13:25 -0000
@@ -1851,7 +1851,7 @@ directory_request_write_metafile (Nautil
 	if (metafile->details->write_idle_id == 0) {
 		bonobo_object_ref (metafile);
 		metafile->details->write_idle_id =
-			gtk_idle_add (metafile_write_idle_callback, metafile);
+			g_idle_add (metafile_write_idle_callback, metafile);
 	}
 }
 
Index: libnautilus-private/nautilus-tree-view-drag-dest.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-tree-view-drag-dest.c,v
retrieving revision 1.3
diff -u -p -r1.3 nautilus-tree-view-drag-dest.c
--- libnautilus-private/nautilus-tree-view-drag-dest.c	8 Feb 2003 22:19:24 -0000	1.3
+++ libnautilus-private/nautilus-tree-view-drag-dest.c	26 Feb 2003 01:13:25 -0000
@@ -126,7 +126,7 @@ static void
 remove_scroll_timeout (NautilusTreeViewDragDest *dest)
 {
 	if (dest->details->scroll_id) {
-		gtk_timeout_remove (dest->details->scroll_id);
+		g_source_remove (dest->details->scroll_id);
 		dest->details->scroll_id = 0;
 	}
 }
@@ -388,9 +388,9 @@ drag_motion_callback (GtkWidget *widget,
 	
 	if (dest->details->scroll_id == 0) {
 		dest->details->scroll_id = 
-			gtk_timeout_add (150, 
-					 scroll_timeout, 
-					 dest->details->tree_view);
+			g_timeout_add (150, 
+				       scroll_timeout, 
+				       dest->details->tree_view);
 	}
 
 	gdk_drag_status (context, action, time);
Index: libnautilus-private/nautilus-volume-monitor.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-volume-monitor.c,v
retrieving revision 1.135
diff -u -p -r1.135 nautilus-volume-monitor.c
--- libnautilus-private/nautilus-volume-monitor.c	29 Aug 2002 10:56:02 -0000	1.135
+++ libnautilus-private/nautilus-volume-monitor.c	26 Feb 2003 01:13:26 -0000
@@ -367,7 +367,7 @@ nautilus_volume_monitor_finalize (GObjec
 	monitor = NAUTILUS_VOLUME_MONITOR (object);
 
 	/* Remove timer function */
-	gtk_timeout_remove (monitor->details->mount_volume_timer_id);
+	g_source_remove (monitor->details->mount_volume_timer_id);
 		
 	/* Clean up mount info */
 	free_mount_list (monitor->details->mounts);
@@ -1316,9 +1316,9 @@ find_volumes (NautilusVolumeMonitor *mon
 
 	/* Add a timer function to check for status change in mounted volumes periodically */
 	monitor->details->mount_volume_timer_id = 
-		gtk_timeout_add (CHECK_STATUS_INTERVAL,
-				 (GtkFunction) mount_volumes_check_status,
-				 monitor);
+		g_timeout_add (CHECK_STATUS_INTERVAL,
+			       (GtkFunction) mount_volumes_check_status,
+			       monitor);
 }
 
 void
@@ -1558,7 +1558,7 @@ close_error_pipe (gboolean mount, const 
 	info->detailed_message = g_strdup (detailed_msg);
 	info->mount_point = g_strdup (mount_path);
 	info->mount = mount;
-	gtk_idle_add (display_mount_error, info);	
+	g_idle_add (display_mount_error, info);	
 }
 
 
Index: src/nautilus-bookmarks-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-bookmarks-window.c,v
retrieving revision 1.73
diff -u -p -r1.73 nautilus-bookmarks-window.c
--- src/nautilus-bookmarks-window.c	6 Nov 2002 10:39:08 -0000	1.73
+++ src/nautilus-bookmarks-window.c	26 Feb 2003 01:13:26 -0000
@@ -712,7 +712,7 @@ on_window_hide_event (GtkWidget *widget,
 	nautilus_undo_unregister (G_OBJECT (uri_field));
 
 	/* restore_geometry only works after window is hidden */
-	gtk_idle_add (restore_geometry, widget);
+	g_idle_add (restore_geometry, widget);
 }
 
 static void
@@ -720,7 +720,7 @@ on_window_destroy_event (GtkWidget *widg
 		      	 gpointer user_data)
 {
 	g_message ("destroying bookmarks window");
-	gtk_idle_remove_by_data (widget);
+	g_source_remove_by_user_data (widget);
 }
 
 static void
Index: src/nautilus-location-bar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-location-bar.c,v
retrieving revision 1.92
diff -u -p -r1.92 nautilus-location-bar.c
--- src/nautilus-location-bar.c	20 Oct 2002 20:30:27 -0000	1.92
+++ src/nautilus-location-bar.c	26 Feb 2003 01:13:26 -0000
@@ -603,7 +603,7 @@ editable_event_after_callback (GtkEntry 
 	if (position_and_selection_are_at_end (editable)) {
 		if (entry_would_have_inserted_characters (keyevent)) {
 			if (bar->details->idle_id == 0) {
-				bar->details->idle_id = gtk_idle_add (try_to_expand_path, bar);
+				bar->details->idle_id = g_idle_add (try_to_expand_path, bar);
 			}
 		}
 	} else {
@@ -611,7 +611,7 @@ editable_event_after_callback (GtkEntry 
 		 * to change the position or selection.
 		 */
 		if (bar->details->idle_id != 0) {
-			gtk_idle_remove (bar->details->idle_id);
+			g_source_remove (bar->details->idle_id);
 			bar->details->idle_id = 0;
 		}
 	}
@@ -654,7 +654,7 @@ destroy (GtkObject *object)
 	
 	/* cancel the pending idle call, if any */
 	if (bar->details->idle_id != 0) {
-		gtk_idle_remove (bar->details->idle_id);
+		g_source_remove (bar->details->idle_id);
 		bar->details->idle_id = 0;
 	}
 	
Index: src/nautilus-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-main.c,v
retrieving revision 1.129
diff -u -p -r1.129 nautilus-main.c
--- src/nautilus-main.c	13 Feb 2003 14:11:25 -0000	1.129
+++ src/nautilus-main.c	26 Feb 2003 01:13:26 -0000
@@ -92,7 +92,7 @@ eel_gtk_main_quit_all (void)
 	 * This idler will be run by the current event loop, killing it, and then
 	 * by the next event loop, ...
 	 */
-	gtk_idle_add (quit_if_in_main_loop, NULL);
+	g_idle_add (quit_if_in_main_loop, NULL);
 }
 
 static void
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	26 Feb 2003 01:13:26 -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	26 Feb 2003 01:13:27 -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,
@@ -216,11 +218,11 @@ shut_down (NautilusViewFrame *view)
 	}
 
 	if (view->details->failed_idle_id != 0) {
-		gtk_idle_remove (view->details->failed_idle_id);
+		g_source_remove (view->details->failed_idle_id);
 		view->details->failed_idle_id = 0;
 	}
 	if (view->details->socket_gone_idle_id != 0) {
-		gtk_idle_remove (view->details->socket_gone_idle_id);
+		g_source_remove (view->details->socket_gone_idle_id);
 		view->details->socket_gone_idle_id = 0;
 	}
 }
@@ -645,7 +647,7 @@ queue_view_frame_failed (NautilusViewFra
 
 	if (view->details->failed_idle_id == 0) {
 		view->details->failed_idle_id =
-			gtk_idle_add (view_frame_failed_callback, view);
+			g_idle_add (view_frame_failed_callback, view);
 	}
 }
 
@@ -699,7 +701,7 @@ check_socket_gone_callback (GtkContainer
 	 * widget in there.
 	 */
 	if (frame->details->socket_gone_idle_id == 0) {
-		frame->details->socket_gone_idle_id = gtk_idle_add
+		frame->details->socket_gone_idle_id = g_idle_add
 			(check_socket_gone_idle_callback, callback_data);
 	}
 }
@@ -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	26 Feb 2003 01:13:27 -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 */
@@ -137,4 +141,8 @@ char *             nautilus_view_frame_g
 void               nautilus_view_frame_set_label                 (NautilusViewFrame   *view,
                                                                   const char          *label);
 
+void               nautilus_view_frame_close_sprung_windows      (NautilusViewFrame   *view);
+void               nautilus_view_frame_open_location_spring_loaded (NautilusViewFrame *view,
+                                                                    const char *location,
+                                                                    GList *selection);
 #endif /* NAUTILUS_VIEW_FRAME_H */
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	26 Feb 2003 01:13:27 -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,
@@ -709,10 +711,18 @@ location_has_really_changed (NautilusWin
 }
 
 static void
+remove_window_from_list (NautilusWindow *window,
+                         gpointer data)
+{
+        spring_loaded_folders = g_list_remove (spring_loaded_folders, window);
+}
+
+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 +753,11 @@ open_location (NautilusWindow *window,
                 target_window = nautilus_application_create_window (
 						window->application,
 						gtk_window_get_screen (GTK_WINDOW (window)));
+                if (spring_loaded) {
+                        g_object_weak_ref (G_OBJECT (target_window),
+                                           (GWeakNotify) remove_window_from_list, NULL);
+                        spring_loaded_folders = g_list_prepend (spring_loaded_folders, target_window);
+                }
 	}
 
 	eel_g_list_free_deep (target_window->details->pending_selection);
@@ -760,7 +775,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 +783,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 +1830,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 +1947,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 +1958,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 +2170,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/nautilus-window-menus.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-menus.c,v
retrieving revision 1.256
diff -u -p -r1.256 nautilus-window-menus.c
--- src/nautilus-window-menus.c	17 Feb 2003 09:20:56 -0000	1.256
+++ src/nautilus-window-menus.c	26 Feb 2003 01:13:28 -0000
@@ -1281,7 +1281,7 @@ void
 nautilus_window_remove_bookmarks_menu_callback (NautilusWindow *window)
 {
         if (window->details->refresh_bookmarks_menu_idle_id != 0) {
-                gtk_idle_remove (window->details->refresh_bookmarks_menu_idle_id);
+                g_source_remove (window->details->refresh_bookmarks_menu_idle_id);
 		window->details->refresh_bookmarks_menu_idle_id = 0;
         }
 }
@@ -1290,7 +1290,7 @@ void
 nautilus_window_remove_go_menu_callback (NautilusWindow *window)
 {
         if (window->details->refresh_go_menu_idle_id != 0) {
-                gtk_idle_remove (window->details->refresh_go_menu_idle_id);
+                g_source_remove (window->details->refresh_go_menu_idle_id);
 		window->details->refresh_go_menu_idle_id = 0;
         }
 }
@@ -1362,8 +1362,8 @@ schedule_refresh_bookmarks_menu (Nautilu
 
 	if (window->details->refresh_bookmarks_menu_idle_id == 0) {
                 window->details->refresh_bookmarks_menu_idle_id
-                        = gtk_idle_add (refresh_bookmarks_menu_idle_callback,
-                                        window);
+                        = g_idle_add (refresh_bookmarks_menu_idle_callback,
+				      window);
 	}	
 }
 
@@ -1421,7 +1421,7 @@ schedule_refresh_go_menu (NautilusWindow
 
 	if (window->details->refresh_go_menu_idle_id == 0) {
                 window->details->refresh_go_menu_idle_id
-                        = gtk_idle_add (refresh_go_menu_idle_callback,
-                                        window);
+                        = g_idle_add (refresh_go_menu_idle_callback,
+				      window);
 	}	
 }
Index: src/nautilus-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.c,v
retrieving revision 1.405
diff -u -p -r1.405 nautilus-window.c
--- src/nautilus-window.c	3 Feb 2003 13:40:31 -0000	1.405
+++ src/nautilus-window.c	26 Feb 2003 01:13:28 -0000
@@ -931,7 +931,7 @@ nautilus_window_finalize (GObject *objec
 	nautilus_window_remove_go_menu_callback (window);
 
 	if (window->details->ui_idle_id != 0) {
-		gtk_idle_remove (window->details->ui_idle_id);
+		g_source_remove (window->details->ui_idle_id);
 	}
 
 	if (window->details->shell_ui != NULL) {
@@ -965,7 +965,7 @@ nautilus_window_finalize (GObject *objec
 	bonobo_object_unref (window->details->ui_container);
 
 	if (window->details->location_change_at_idle_id != 0) {
-		gtk_idle_remove (window->details->location_change_at_idle_id);
+		g_source_remove (window->details->location_change_at_idle_id);
 	}
 
 	g_free (window->details->title);
Index: src/file-manager/fm-desktop-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-desktop-icon-view.c,v
retrieving revision 1.199
diff -u -p -r1.199 fm-desktop-icon-view.c
--- src/file-manager/fm-desktop-icon-view.c	5 Feb 2003 14:06:15 -0000	1.199
+++ src/file-manager/fm-desktop-icon-view.c	26 Feb 2003 01:13:29 -0000
@@ -263,7 +263,7 @@ fm_desktop_icon_view_finalize (GObject *
 
 	/* Remove desktop rescan timeout. */
 	if (icon_view->details->reload_desktop_timeout != 0) {
-		gtk_timeout_remove (icon_view->details->reload_desktop_timeout);
+		g_source_remove (icon_view->details->reload_desktop_timeout);
 	}
 
 	/* Delete all of the link files. */
@@ -618,7 +618,7 @@ delayed_init (FMDesktopIconView *desktop
 
 	/* Monitor desktop directory. */
 	desktop_icon_view->details->reload_desktop_timeout =
-		gtk_timeout_add (RESCAN_TIMEOUT, do_desktop_rescan, desktop_icon_view);
+		g_timeout_add (RESCAN_TIMEOUT, do_desktop_rescan, desktop_icon_view);
 
 	g_signal_handler_disconnect (desktop_icon_view,
 				     desktop_icon_view->details->delayed_init_signal);
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.562
diff -u -p -r1.562 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	18 Feb 2003 15:14:10 -0000	1.562
+++ src/file-manager/fm-directory-view.c	26 Feb 2003 01:13:30 -0000
@@ -1410,7 +1410,7 @@ fm_directory_view_finalize (GObject *obj
 	nautilus_file_unref (view->details->directory_as_file);
 
 	if (view->details->display_selection_idle_id != 0) {
-		gtk_idle_remove (view->details->display_selection_idle_id);
+		g_source_remove (view->details->display_selection_idle_id);
 	}
 
 	remove_update_menus_timeout_callback (view);
@@ -2246,7 +2246,7 @@ static void
 remove_update_menus_timeout_callback (FMDirectoryView *view) 
 {
 	if (view->details->update_menus_timeout_id != 0) {
-		gtk_timeout_remove (view->details->update_menus_timeout_id);
+		g_source_remove (view->details->update_menus_timeout_id);
 		view->details->update_menus_timeout_id = 0;
 	}
 }
@@ -2334,7 +2334,7 @@ schedule_idle_display_of_pending_files (
 	unschedule_timeout_display_of_pending_files (view);
 
 	view->details->display_pending_idle_id =
-		gtk_idle_add_priority (G_PRIORITY_LOW, display_pending_idle_callback, view);
+		g_idle_add_full (G_PRIORITY_LOW, display_pending_idle_callback, view, NULL);
 }
 
 static void
@@ -2351,8 +2351,8 @@ schedule_timeout_display_of_pending_file
 	}
 
 	view->details->display_pending_timeout_id =
-		gtk_timeout_add (DISPLAY_TIMEOUT_INTERVAL_MSECS,
-				 display_pending_timeout_callback, view);
+		g_timeout_add (DISPLAY_TIMEOUT_INTERVAL_MSECS,
+			       display_pending_timeout_callback, view);
 }
 
 static void
@@ -2361,7 +2361,7 @@ unschedule_idle_display_of_pending_files
 	/* Get rid of idle if it's active. */
 	if (view->details->display_pending_idle_id != 0) {
 		g_assert (view->details->display_pending_timeout_id == 0);
-		gtk_idle_remove (view->details->display_pending_idle_id);
+		g_source_remove (view->details->display_pending_idle_id);
 		view->details->display_pending_idle_id = 0;
 	}
 }
@@ -2372,7 +2372,7 @@ unschedule_timeout_display_of_pending_fi
 	/* Get rid of timeout if it's active. */
 	if (view->details->display_pending_timeout_id != 0) {
 		g_assert (view->details->display_pending_idle_id == 0);
-		gtk_timeout_remove (view->details->display_pending_timeout_id);
+		g_source_remove (view->details->display_pending_timeout_id);
 		view->details->display_pending_timeout_id = 0;
 	}
 }
@@ -4893,7 +4893,7 @@ schedule_update_menus (FMDirectoryView *
 	if (view->details->menus_merged
 	    && view->details->update_menus_timeout_id == 0) {
 		view->details->update_menus_timeout_id
-			= gtk_timeout_add (300, update_menus_timeout_callback, view);
+			= g_timeout_add (300, update_menus_timeout_callback, view);
 	}
 }
 
@@ -4917,8 +4917,8 @@ fm_directory_view_notify_selection_chang
 	/* Schedule a display of the new selection. */
 	if (view->details->display_selection_idle_id == 0) {
 		view->details->display_selection_idle_id
-			= gtk_idle_add (display_selection_info_idle_callback,
-					view);
+			= g_idle_add (display_selection_info_idle_callback,
+				      view);
 	}
 
 	if (view->details->batching_selection_level != 0) {
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	26 Feb 2003 01:13:31 -0000
@@ -101,6 +101,8 @@
 #define ID_TIGHTER_LAYOUT                       "Tighter Layout"
 #define ID_SORT_REVERSED                        "Reversed Order"
 
+#define SPRING_FOLDERS_DELAY                    500
+
 typedef struct {
 	NautilusFileSortType sort_type;
 	const char *metadata_text;
@@ -136,6 +138,9 @@ struct FMIconViewDetails
 
 	gboolean filter_by_screen;
 	int num_screens;
+
+	guint spring_id;
+	NautilusFile *spring_drop_target;
 };
 
 
@@ -226,7 +231,7 @@ fm_icon_view_finalize (GObject *object)
 	}
 
         if (icon_view->details->react_to_icon_change_idle_id != 0) {
-                gtk_idle_remove (icon_view->details->react_to_icon_change_idle_id);
+                g_source_remove (icon_view->details->react_to_icon_change_idle_id);
         }
 
 	/* kill any sound preview process that is ongoing */
@@ -1704,17 +1709,17 @@ preview_audio (FMIconView *icon_view, Na
 	}
 #endif
 	if (icon_view->details->audio_preview_timeout != 0) {
-		gtk_timeout_remove (icon_view->details->audio_preview_timeout);
+		g_source_remove (icon_view->details->audio_preview_timeout);
 		icon_view->details->audio_preview_timeout = 0;
 	}
 			
 	if (start_flag) {
 		icon_view->details->audio_preview_file = file;
 #if USE_OLD_AUDIO_PREVIEW			
-		icon_view->details->audio_preview_timeout = gtk_timeout_add (1000, play_file, icon_view);
+		icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view);
 #else
 		/* FIXME: Need to kill the existing timeout if there is one? */
-		icon_view->details->audio_preview_timeout = gtk_timeout_add (1000, play_file, icon_view);
+		icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view);
 #endif
 	}
 }
@@ -1850,6 +1855,57 @@ 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;
+	char *location_uri;
+
+	icon_view = data;
+	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 (SPRING_FOLDERS_DELAY, spring_folder, icon_view);
+}
+
+static void
+drag_end_callback (NautilusIconContainer *container,
+		   GdkDragContext *context,
+		   FMIconView *icon_view)
+{
+	NautilusView *view;
+
+	if (icon_view->details->spring_id > 0) {
+		g_source_remove (icon_view->details->spring_id);
+		icon_view->details->spring_id = 0;
+	}
+	
+	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,
@@ -1925,8 +1981,8 @@ icon_position_changed_callback (Nautilus
 	 */
 	if (icon_view->details->react_to_icon_change_idle_id == 0) {
                 icon_view->details->react_to_icon_change_idle_id
-                        = gtk_idle_add (fm_icon_view_react_to_icon_change_idle_callback,
-                                        icon_view);
+                        = g_idle_add (fm_icon_view_react_to_icon_change_idle_callback,
+				      icon_view);
 	}
 
 	/* Store the new position of the icon in the metadata. */
@@ -2238,6 +2294,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);
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.165
diff -u -p -r1.165 fm-properties-window.c
--- src/file-manager/fm-properties-window.c	4 Dec 2002 08:35:46 -0000	1.165
+++ src/file-manager/fm-properties-window.c	26 Feb 2003 01:13:31 -0000
@@ -1281,9 +1281,9 @@ schedule_directory_contents_update (FMPr
 
 	if (window->details->update_directory_contents_timeout_id == 0) {
 		window->details->update_directory_contents_timeout_id
-			= gtk_timeout_add (DIRECTORY_CONTENTS_UPDATE_INTERVAL,
-					   update_directory_contents_callback,
-					   window);
+			= g_timeout_add (DIRECTORY_CONTENTS_UPDATE_INTERVAL,
+					 update_directory_contents_callback,
+					 window);
 	}
 }
 
@@ -2663,7 +2663,7 @@ real_destroy (GtkObject *object)
 	window->details->special_flags_widgets = NULL;
 
 	if (window->details->update_directory_contents_timeout_id != 0) {
-		gtk_timeout_remove (window->details->update_directory_contents_timeout_id);
+		g_source_remove (window->details->update_directory_contents_timeout_id);
 		window->details->update_directory_contents_timeout_id = 0;
 	}
 


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