Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.392
diff -u -p -r1.392 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	6 Jul 2005 12:18:27 -0000	1.392
+++ libnautilus-private/nautilus-icon-container.c	12 Jul 2005 16:13:02 -0000
@@ -1771,26 +1782,50 @@ select_range (NautilusIconContainer *con
 
 	unmatched_icon = NULL;
 	select = FALSE;
-	for (p = container->details->icons; p != NULL; p = p->next) {
-		icon = p->data;
+	if (container->details->auto_layout) {
+		for (p = container->details->icons; p != NULL; p = p->next) {
+			icon = p->data;
 
-		if (unmatched_icon == NULL) {
-			if (icon == icon1) {
-				unmatched_icon = icon2;
-				select = TRUE;
-			} else if (icon == icon2) {
-				unmatched_icon = icon1;
-				select = TRUE;
+			if (unmatched_icon == NULL) {
+				if (icon == icon1) {
+					unmatched_icon = icon2;
+					select = TRUE;
+				} else if (icon == icon2) {
+					unmatched_icon = icon1;
+					select = TRUE;
+				}
+			}
+			
+			selection_changed |= icon_set_selected
+				(container, icon, select);
+
+			if (unmatched_icon != NULL && icon == unmatched_icon) {
+				select = FALSE;
 			}
+			
 		}
-		
-		selection_changed |= icon_set_selected
-			(container, icon, select);
+	} else {
+		double x0, x1, y0, y1;
 
-		if (unmatched_icon != NULL && icon == unmatched_icon) {
-			select = FALSE;
+		x0 = MIN (icon1->x, icon2->x);
+		x1 = MAX (icon1->x, icon2->x);
+		y0 = MIN (icon1->y, icon2->y);
+		y1 = MAX (icon1->y, icon2->y);
+
+		for (p = container->details->icons; p != NULL; p = p->next) {
+			icon = p->data;
+
+			if (icon->x >= x0 && icon->x <= x1 &&
+			    icon->y >= y0 && icon->y <= y1) {
+				select = TRUE;
+			} else {
+				select = FALSE;
+			}
+			
+			selection_changed |= icon_set_selected
+				(container, icon, select);
 		}
-		
+
 	}
 	
 	if (selection_changed && icon2 != NULL) {
