Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.376
diff -p -u -r1.376 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	6 Oct 2004 14:03:05 -0000	1.376
+++ libnautilus-private/nautilus-icon-container.c	13 Oct 2004 16:49:46 -0000
@@ -3168,6 +3168,9 @@ button_press_event (GtkWidget *widget,
     	}
 
 	if (clicked_on_icon) {
+		gdk_window_begin_mouse_action (gdk_window_get_toplevel (widget->window),
+					       GDK_MOUSE_ACTION_DND,
+					       event->time);
 		return TRUE;
 	}
 
@@ -3195,8 +3198,15 @@ button_press_event (GtkWidget *widget,
 			}
 		}
 
+		gdk_window_begin_mouse_action (gdk_window_get_toplevel (widget->window),
+					       GDK_MOUSE_ACTION_SELECTION,
+					       event->time);
 		start_rubberbanding (container, event);
 		return TRUE;
+	} else {
+		gdk_window_begin_mouse_action (gdk_window_get_toplevel (widget->window),
+					       GDK_MOUSE_ACTION_NONE,
+					       event->time);
 	}
 
 	/* Prevent multi-button weirdness such as bug 6181 */
@@ -3497,6 +3507,9 @@ button_release_event (GtkWidget *widget,
 	details = container->details;
 
 	if (event->button == RUBBERBAND_BUTTON && details->rubberband_info.active) {
+		gdk_window_end_mouse_action (gdk_window_get_toplevel (widget->window),
+					     GDK_MOUSE_ACTION_SELECTION,
+					     event->time);
 		stop_rubberbanding (container, event);
 		return TRUE;
 	}
@@ -3507,8 +3520,16 @@ button_release_event (GtkWidget *widget,
 		switch (details->drag_state) {
 		case DRAG_STATE_MOVE_OR_COPY:
 			if (!details->drag_started) {
+				gdk_window_end_mouse_action (gdk_window_get_toplevel (widget->window),
+							     GDK_MOUSE_ACTION_DND,
+							     event->time);
+
 				nautilus_icon_container_did_not_drag (container, event);
 			} else {
+				/* No need to call gdk_window_end_mouse_action
+				 * here because gtkdnd.c handles it.
+				 */
+
 				nautilus_icon_dnd_end_drag (container);
 			}
 			break;
@@ -3542,7 +3563,14 @@ motion_notify_event (GtkWidget *widget,
 
 	remove_context_menu_timeout (container);
 
+	if (details->rubberband_info.active) {
+		gdk_window_mouse_motion_occurred (gdk_window_get_toplevel (widget->window));
+	}
+
 	if (details->drag_button != 0) {
+		/* No need to call gdk_window_mouse_motion_occurred() here
+		 * because gtkdnd.c should take care of it.
+		 */
 		switch (details->drag_state) {
 		case DRAG_STATE_MOVE_OR_COPY:
 			if (details->drag_started) {
