2006-03-18  Federico Mena Quintero  <federico@novell.com>

	* libnautilus-private/nautilus-icon-private.h
	(NautilusIconContainerDetails): New flag "is_reloading".

	* libnautilus-private/nautilus-icon-container.h: New prototype for
	nautilus_icon_container_set_is_reloading().

	* libnautilus-private/nautilus-icon-container.c
	(nautilus_icon_container_set_is_reloading): New function; sets an
	is_reloading flag in the icon container.

	* src/file-manager/fm-icon-view.c (fm_icon_view_begin_loading):
	Tell the icon container that we just started reloading.
	(fm_icon_view_end_loading): Tell the icon container that we
	finished loading.

--- nautilus-2.12.2/libnautilus-private/nautilus-icon-private.h	2006-03-18 21:50:05.000000000 -0600
+++ nautilus-2.12.2.patched/libnautilus-private/nautilus-icon-private.h	2006-03-18 18:38:27.000000000 -0600
@@ -258,6 +258,8 @@ struct NautilusIconContainerDetails {
 	/* a11y items used by canvas items */
 	guint a11y_item_action_idle_handler;
 	GQueue* a11y_item_action_queue;
+
+	eel_boolean_bit is_reloading : 1;
 };
 
 /* Private functions shared by mutiple files. */
--- nautilus-2.12.2/libnautilus-private/nautilus-icon-container.h	2006-03-18 21:50:05.000000000 -0600
+++ nautilus-2.12.2.patched/libnautilus-private/nautilus-icon-container.h	2006-03-18 18:36:58.000000000 -0600
@@ -223,6 +223,8 @@ void              nautilus_icon_containe
 									 NautilusIconData       *data);
 
 /* control the layout */
+void              nautilus_icon_container_set_is_reloading              (NautilusIconContainer  *container,
+									 gboolean                is_reloading);
 gboolean          nautilus_icon_container_is_auto_layout                (NautilusIconContainer  *container);
 void              nautilus_icon_container_set_auto_layout               (NautilusIconContainer  *container,
 									 gboolean                auto_layout);
--- nautilus-2.12.2/libnautilus-private/nautilus-icon-container.c	2006-03-18 21:50:06.000000000 -0600
+++ nautilus-2.12.2.patched/libnautilus-private/nautilus-icon-container.c	2006-03-18 21:47:50.000000000 -0600
@@ -337,7 +337,7 @@ icon_set_position (NautilusIcon *icon,
 	if (icon->y == ICON_UNPOSITIONED_VALUE) {
 		icon->y = 0;
 	}
-	
+
 	eel_canvas_item_move (EEL_CANVAS_ITEM (icon->item),
 				x - icon->x,
 				y - icon->y);
@@ -5168,7 +5168,7 @@ finish_adding_new_icons (NautilusIconCon
 	for (p = new_icons; p != NULL; p = p->next) {
 		icon = p->data;
 		if (assign_icon_position (container, icon)) {
-			if (!container->details->auto_layout && icon->has_lazy_position) {
+			if (!container->details->is_reloading && !container->details->auto_layout && icon->has_lazy_position) {
 				semi_position_icons = g_list_prepend (semi_position_icons, icon);
 			}
 		} else {
@@ -6117,6 +6117,15 @@ nautilus_icon_container_sort (NautilusIc
 	}
 }
 
+void
+nautilus_icon_container_set_is_reloading (NautilusIconContainer *container,
+					  gboolean               is_reloading)
+{
+	g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
+
+	container->details->is_reloading = is_reloading;
+}
+
 gboolean
 nautilus_icon_container_is_auto_layout (NautilusIconContainer *container)
 {
--- nautilus-2.12.2/src/file-manager/fm-icon-view.c	2006-03-18 21:50:05.000000000 -0600
+++ nautilus-2.12.2.patched/src/file-manager/fm-icon-view.c	2006-03-18 18:35:05.000000000 -0600
@@ -1055,6 +1055,8 @@ fm_icon_view_begin_loading (FMDirectoryV
 	file = fm_directory_view_get_directory_as_file (view);
 	icon_container = GTK_WIDGET (get_icon_container (icon_view));
 
+	nautilus_icon_container_set_is_reloading (NAUTILUS_ICON_CONTAINER (icon_container), TRUE);
+
 	nautilus_icon_container_set_allow_moves (NAUTILUS_ICON_CONTAINER (icon_container),
 						 fm_directory_view_get_allow_moves (view));
 
@@ -1129,6 +1131,7 @@ fm_icon_view_end_loading (FMDirectoryVie
 	FMIconView *icon_view;
 
 	icon_view = FM_ICON_VIEW (view);
+	nautilus_icon_container_set_is_reloading (get_icon_container (icon_view), FALSE);
 }
 
 static NautilusZoomLevel
